use POSIX qw(strftime); my $format = "Current time minutes: %M, seconds: %S\n"; print strftime $format, localtime;