+ return ("Log search error", $@) if $@;
+ my @tmp;
+ while (@in) {
+ last L1 if $count >= $to;
+ my $ref = [ split /\^/, shift @in ];
+ next if defined $pattern && $ref->[1] ne $pattern;
+ push @tmp, print_item($ref);
+ $count++;
+ }
+ @out = (@tmp, @out);