in reply to Turning an argument into a regexp
If $searchfor contained characters special to regexp (eg '.' or '?') then you won't get quite the results you expect, and your program may crash with an invalid regexp error. Use \Q and \E something like this...
my $MP3dir = $ARGV[0]; my $searchfor = $ARGV[1]; find(\&wanted, $MP3dir); sub wanted { /\.\Q$searchfor\E$/ or return
|
|---|