http://qs1969.pair.com?node_id=30359

LoneRanger has asked for the wisdom of the Perl Monks concerning the following question:

This code snippet is part of a playlist generator. I'd like to be able to take in arguments such as dir. to start searching at, and what to search for. The File::Find mod. seems to have some probs with the regexp being a variable...Any solutions?
my $MP3dir = $ARGV[0]; my $searchfor = $ARGV[1]; #$MP3dir = "\"" . $MP3dir . "\""; my $regexp = "\/\\.$searchfor\/"; find(\&wanted, $MP3dir); sub wanted { $regexp or return;