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
In reply to Re: A better regex
by Abigail-II
in thread A better regex
by williamp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |