use POSIX ; my $now = POSIX::strftime( "%H%M", localtime ) ; print $now, "\n" ;