perlnewbie9292
Programmer
Hello everyone,
I am pretty new to Perl and hoping someone can please point me in the right direction. I am trying to do stuff based on timestamp from the hour field.
I am doing something like this:
If there anyway to either only show single digits for hours 00-09 or when running a range to be able to specify or be count ignoring the first 0 in the 00..09. Not sure if that make sense to everyone .
So what I am trying to do is:
$hour = 2..9 instead of this:
$hour = 02..09
I guess I could do a substitution to get rid of the first 0 if it starts with a 0 digit but hoping there is cleaner/better way to do this.
I am using my $hourOfTheDay = strftime( '%H', localtime );
to get the hour digits.
Thanks for the help in advance.
I am pretty new to Perl and hoping someone can please point me in the right direction. I am trying to do stuff based on timestamp from the hour field.
I am doing something like this:
Code:
if ( $hour = 2..9 )
{
DOING STUFF HERE
}
If there anyway to either only show single digits for hours 00-09 or when running a range to be able to specify or be count ignoring the first 0 in the 00..09. Not sure if that make sense to everyone .
So what I am trying to do is:
$hour = 2..9 instead of this:
$hour = 02..09
I guess I could do a substitution to get rid of the first 0 if it starts with a 0 digit but hoping there is cleaner/better way to do this.
I am using my $hourOfTheDay = strftime( '%H', localtime );
to get the hour digits.
Thanks for the help in advance.