my %time=reverse split(/([HMS])/, '5H3M17S'); no warnings 'uninitialized'; my $time=$time{H}*60*60+$time{M}*60+$time{S};