my $fcb = $DXLog::log;
my $from = shift;
my $to = shift;
- my @date = Julian::unixtojm(shift);
+ my $jdate = $fcb->unixtoj(shift);
my $pattern = shift;
my $who = uc shift;
my $search;
my $count;
my $hint = "";
- $search = '1' unless $pattern || $who;
if ($pattern) {
- $search = "\$ref->[1] =~ m{$pattern}i";
+ $search = "\$ref->[1] =~ m{^$pattern}i";
$hint = "m{$pattern}i";
}
-
if ($who) {
if ($search) {
$search .= ' && ';
$hint .= 'm{$who}i';
}
$hint = "next unless $hint" if $hint;
+ $search = "1" unless $search;
$eval = qq(
\@in = ();
if ($search) {
\$count++;
next if \$count < $from;
- push \@out, print_item(\$ref);
+ unshift \@out, print_item(\$ref);
last if \$count >= \$to; # stop after n
}
}
$fcb->close; # close any open files
- my $fh = $fcb->open(@date);
+ my $fh = $fcb->open($jdate);
for ($count = 0; $count < $to; ) {
my $ref;
if ($fh) {