Bravo! (Just what I was thinking).
However, as an alternative to using no warnings 'uninitialized' (always appear as though you thought of everything), try OR-ing the hash values with 0, like this:
my %time=reverse split(/([HMS])/, '5H3M17S'); my $time = (( (($time{H}||0) * 60) + ($time{M}||0)) * 60) + ($time{S}| +|0);
dmm
In reply to Re: (dmm): Time to seconds
by dmmiller2k
in thread Time to seconds
by argus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |