I'd do someting like this:
and insert an lc if you want to accept upper-case extensions too.use List::Util; $name =~ /\.([^.]*)\z/ and List::Util::first { $1 eq $_ } qw"sdp rtsp rts mov whatever" or die "wrong extension"
Btw, there seems to be a space missing here in your code:
.vfw .flc.fli .wav
In reply to Re: file extensions
by ambrus
in thread file extensions
by coldfingertips
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |