On 02/24/04 13:49, rmck wrote:
Help

I need this variable $time to show last hour (00..23) So if hour is 00, I want 23. If hour is 01, I want 00, etc.....

I can run that awk statement on the command line and it works great, but if I try it in the script it fails with an awk syntax error...

Is there a way to look at last hour with $time1 ?? I would rather keep it all perl.....

my $hour = sprintf("%02d", (localtime)[2]-1);


see 'perldoc -f localtime'

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to