in reply to Turning an argument into a regexp

It's because wanted isn't evaluating the regexp, it's merely treating it as a string.

Try removing the '\/' from the front and end of your $regexp string, then this code fragment.
sub wanted { /$regexp/ or return; }
Just for the record, you may want to use /$regexp/i to ignore case from the command line, and play both those .MP3 and .mp3 files. Also, this line: $MP3dir = "\"" . $MP3dir . "\""; can be reduced to $MP3dir = "\"$MP3dir\""; There are other ways to quote that, also. That's just a tad more readable.

--Chris

e-mail jcwren