Not sure what you're really doing but the /zip$/ works-
use warnings; # Don't leave out! use strict; # This neither! my @files = qw( zip.meta some.zip ); for my $file ( @files ) { print $file, "\n"; print $file =~ /zip$/ ? "\tZip!\n" : "\tNada y pues nada...\n"; }
I don't know exactly what you're doing but you always keep in mind that trusting user data or even file extensions is a mistake. Test/validate. Just because it ends in .zip doesn't mean it's a zip file. So you might want to ask about your final goal instead of your code difficulty with the matches.
In reply to Re: Regex for zip files.
by Your Mother
in thread Regex for zip files.
by Karger78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |