foreach my $eachday (@the_days) { print $eachday; # "eachday" is a bad name }; use POSIX qw(strftime); print strftime('%Y ...', localtime)