in reply to A better regex

foreach my $zipfile (@files) { my $day = undef; $zipfile =~ m/AFILE_(\d+)/; $zipfile =~ m/BFILE_(\d+)/; $day = $1; }

That code isn't correct. If @files contains for instance "AFILE_foo.zip", neither of the regexes matches, and $1 will still be the result of the previous successful match.

Abigail