in reply to Regex for zip files.

You could refine your patterns such that both can't match, or you could use an elsif.
if ($uploads[$count] =~ /zip$/i) { print "I GOT A ZIP"; } elsif ($uploads[$count] =~ /meta/) { print "I GOT A META" } else { print "I got NADA" }

Replies are listed 'Best First'.
Re^2: Regex for zip files.
by afoken (Chancellor) on Jun 09, 2009 at 21:40 UTC
    1. /zip$/i matches any filename ending in "zip" in upper or lower case, including filenames without a dot ("zappzip" and "foobar.notazip" would match).
    2. /meta/ matches any filename that contains meta ("metaphysic-illustrations.gif" would match), not only those that end with ".zip.meta".
    3. The first RE is case-insensitiv, the second RE isn't. Why?

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)