Use the strftime function from the POSIX module to assign your date string. It is much easier and cleaner.

Code

my $date = strftime("%d.%m.%Y", localtime);

Quote

Code

my $location = "archive\$mday.$mon.$year";

Use a forward slash instead of the backslash and use the var that was already assigned the datestamp.

Code

my $location = "archive/$date"

Quote

Code

open(F, '>>:utf8', $location); print F "my string";

1) use a lexical var for the filehandle instead of the bareword 2) ALWAYS check the return code of an open call to verify it was successful and take proper action if it wasn't 3) Why are you using printf without specifying a format? It's better to use print if you don't need the printf formatting