in reply to Why do I keep getting this error message?

Either $month or $year1 has not been assigned a value.

When an error like this occurs with a variable in a double-quoted string (or its ilk) Perl refers to it as concatenation. It's as if you had typed

     "My name is " . $myname
instead of
     "My name is $myname"
If you want to know which one it is, simply print out each one on lines just before the error line. Or sometimes if I think this may happen again some day. I alter the code (with a reminder of why I left it that way) and just leave it as:
# my $string = "$month$year1"; my $string = $month; # separate vars for easier debug $string .= $year1; # separate vars for easier debug
This way I don't need to come back to remove the print trace statements. And if the problem happens again, I can zero in on it immediately.