All righty then. Give this structure a spin.
my @files = qw( zip.meta some.zip whoops.txt meta.zip ); for my $file ( @files ) { if ( $file =~ /\.zip\z/ ) { process_zip($file); } elsif ( $file =~ /\bzip\.meta\z/ ) # or maybe \.meta\z/ { process_meta($file); } else { warn "Don't know what to do with '$file'"; } } sub process_zip { my $zip = shift; print "process_zip got '$zip'\n"; } sub process_meta { my $meta = shift; print "process_meta got '$meta'\n"; }
In reply to Re: Regex for zip files.
by Your Mother
in thread Regex for zip files.
by Karger78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |