in reply to create file with current date for name

The '1' is appended because you are using printf instead of sprintf:
my $ymd = sprintf("%04d%02d%02d",$year+1900,$mon+1,$mday);
This will fix your '1.summary' problem as well. This is a very easy mistake to make - i remember it making myself a few years ago programming in C++. :D