my @lt = localtime(time); my $filename = sprintf "%s/%04d%02d%02d%02d%02d%02d", $directory, $lt[5]+1900, $lt[4]+1, @lt[3,2,1,0];