Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm guessing that this is one of those extremely simple problems - I just can't see where I'm going wrong. Any help would be greatly appreciated!@lines = <LOGFILE>; foreach $line (@lines) { if ($line != m/\s/) { # regex to turn dates into epoch ($dd, $mm, $yy, $hh, $mt, $tt, $tdd, $tmm, $tyy, $thh, $tmt, $ttt) = $ +line =~ /(\d+)-(\d+)-(\d+)\s(\d+):(\d+)\s(am|pm)-(\d+)-(\d+)-(\d+)\s( +\d+):(\d+)\s(am|pm)/; if ($tt == 'pm') { $hh = $hh + 12; } if ($ttt == 'pm') { $thh = $thh + 12; } $t_from = timelocal(0,$mt,$hh,$dd,$mm,$yy); $t_to = timelocal(0,$tmt,$thh,$tdd,$tmm,$tyy); $s_elapsed = $t_to - $t_from; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple log parser
by seeker (Curate) on Aug 15, 2002 at 14:16 UTC | |
|
Re: Simple log parser
by dimmesdale (Friar) on Aug 15, 2002 at 14:20 UTC | |
|
Re: Simple log parser
by grummerX (Pilgrim) on Aug 15, 2002 at 14:13 UTC | |
|
Re: Simple log parser
by Anonymous Monk on Aug 15, 2002 at 15:21 UTC |