leonidlm has asked for the wisdom of the Perl Monks concerning the following question:
Thankswhile (<LOGFILE>) { #print "$_"; # Found the "PWorld.dumper - total" string in one of the lines if ($_ =~ /(\d{2}):(\d{2}):(\d{2}).+PWorld\.dumper - total/) { $sec = $3; $min = $2; $hour = $1; $tempTime = timelocal($sec,$min,$hour,$day,$mon-1,$year); if ($storedDumpLastTime != 0) { $delta = ($tempTime - $storedDumpLastTime); # delta in +seconds! $lastTime = scalar localtime($storedDumpLastTime); $currTime = scalar localtime($tempTime); $cmdDumpDelta = "opcmon $tag=$delta -object dumpDelta -opt +ion lasttime=\"$lastTime\" -option currtime=\"$currTime\""; } $storedDumpLastTime = $tempTime; $dumpedToday = 1; } #print "line: $_"; } # Store the EOF in the configuration file as the next start point $storedCurrPlace = tell(LOGFILE); close(LOGFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: null character problem
by zentara (Cardinal) on Sep 03, 2007 at 16:54 UTC | |
by leonidlm (Pilgrim) on Sep 05, 2007 at 08:38 UTC | |
by zentara (Cardinal) on Sep 05, 2007 at 13:16 UTC | |
by leonidlm (Pilgrim) on Sep 06, 2007 at 08:12 UTC |