use Modern::Perl; say timeLeft( 14, 30, 00 ); sub timeLeft { my ( @time, $nowScs, $thenScs ) = ( localtime(time) )[ 2, 1, 0 ]; for ( 0 .. 2 ) { $nowScs += $time[ 2 - $_ ] * 60**$_; $thenScs += $_[ 2 - $_ ] * 60**$_; } $thenScs - $nowScs; } #### 1203