- or download this
my ($h,$m,$s) = ...;
$m = "0$m" if $m < 10;
$s = "0$s" if $s < 10;
my $dur = "$h:$m:$s";
- or download this
my ($h,$m,$s) = ...;
my $dur = sprintf("%d:%02d:%02d", $h,$m,$s);
- or download this
%d Signed 32/64-bit integer
%2d ...space padded (on the left) to occupy (at least) 2 columns
%02d ...zero padded (on the left) to occupy (at least) 2 columns
- or download this
print get_duration('s1');
- or download this
print get_duration($durations{s1});
- or download this
print get_duration(@{ $durations{s1} });