use POSIX 'strftime'; my $mdyt = strftime '%m/%d/%Y %H:%M:%S', localtime;