sub seconds { if( $_[0] =~ /^(\d+):(\d+):(\d+)$/ ) { return ($1 * 60 + $2) * 60 + $3; } else { return 0; } }