X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXLogPrint.pm;h=60f8b685bb8768e3e935629aca988c2b0bcd2d06;hb=0bd9d2811cc42417676a1b11b121681c2377d70a;hp=9c5633e1fbf2d3bb085d8eeec62c4bf267ebd3b5;hpb=f3adc82a0299652d929b73c718127fa38571eec5;p=spider.git diff --git a/perl/DXLogPrint.pm b/perl/DXLogPrint.pm index 9c5633e1..60f8b685 100644 --- a/perl/DXLogPrint.pm +++ b/perl/DXLogPrint.pm @@ -8,13 +8,12 @@ package DXLog; -use FileHandle; +use IO::File; use DXVars; -use DXDebug (); +#use DXDebug (); use DXUtil; use DXLog; use Julian; -use Carp; use strict; @@ -25,15 +24,15 @@ use strict; # sub print { - my $self = $DXLog::log; + my $fcb = $DXLog::log; my $from = shift; my $to = shift; - my @date = $self->unixtoj(shift); + my @date = Julian::unixtojm(shift); my $pattern = shift; my $who = uc shift; my $search; my @in; - my @out; + my @out = (); my $eval; my $count; @@ -55,25 +54,28 @@ sub print } ); - $self->close; # close any open files + $fcb->close; # close any open files - my $fh = $self->open(@date); + my $fh = $fcb->open(@date); for ($count = 0; $count < $to; ) { - my @spots = (); + my $ref; if ($fh) { + @in = (); while (<$fh>) { chomp; - push @in, [ split '\^' ]; + $ref = [ split '\^' ]; + push @{$ref}, "" unless @{$ref} >= 4; + push @in, $ref; } eval $eval; # do the search on this file last if $count >= $to; # stop after n return ("Log search error", $@) if $@; } - $fh = $self->openprev(); # get the next file + $fh = $fcb->openprev(); # get the next file last if !$fh; } - return @out if defined @out; + return @out; } #