![]() |
|
Do you know where your variables are? | |
PerlMonks |
Re^2: Diff'ing datesby LighthouseJ (Sexton) |
on Oct 02, 2007 at 14:33 UTC ( [id://642117]=note: print w/replies, xml ) | Need Help?? |
Using your inspiring one-liner, I morphed my script with yours and came up with this: /bin/perl -MTime::Local -ne '{$t[1]-- && push(@epochs,timelocal(@t[5,4,3,2,1,6])) if (@t=split)} END { print $epochs[1] - $epochs[0]; }' The END block is most likely what will change because the value of the diff will be used to determine exit status. Thanks a lot for the fresh perspective, it was very helpful.
"The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for why." -- `man perl`
In Section
Seekers of Perl Wisdom
|
|