in reply to matching and backreferencing filenames
First of all '.' in your regex doesn't only match '.' but almost anything
If you have one filename per line and each starting at the beginning of the line, you don't need to constrain your search expression with \w, use the more general '.'
if ( $file =~ /(.+)\.(jpg|JPG|gif|GIF|wmv|WMV|mpg|MPG|avi|AVI)$/ )
|
---|
In Section
Seekers of Perl Wisdom