#!/usr/bin/perl use warnings; use strict; use File::Slurp qw/slurp/; use DBI; my $dbfile = shift; my $R = shift; die unless ($dbfile and $R); my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","",{ AutoCommit => 1 })); my $fst = $dbh->selectall_arrayref(“SELECT min(time_1),max(time_1) FROM mail_data”); foreach my $row (@$fst) { my ($fst_pr,$lst_pr) = @$row; print “oldest entry in database: “.gmtime($fst_pr).” gmt
newest entry in database: “.gmtime($lst_pr); } __END__ my $cnt = `cat -n $file`; my $b = qr/(\{(?:[^{}]++|(?-1))*+\})/; while ($cnt =~ m/\s*(\d+).*?([\w_]+)\s*\(.*?\)\s*$b/g) { my ($begin, $name, $rest) = ($1, $2, $3); #print "B $1 n $2 E $3\n"; my @ls = split /\n/, $rest; $ls[-1] =~ m/\s*(\d+)/; my $end = $1; print "Name $name Begin $begin End $end\n"; }