Help for this page

Select Code to Download


  1. or download this
    (my $secs = "5H3M17S") =~ s/((\d+)H)?((\d+)M)?((\d+)S)?/3600*$1 + 60*$
    +3 + $5/e;
    
  2. or download this
    use strict;
    
    ...
    my $exponent = 0;
    
    map { $secs += $_ * 60 ** $exponent++ } reverse(split(/[HMS]/, $time))
    +;