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;
|
---|
Replies are listed 'Best First'. | |
---|---|
(jcwren) Re: Turning an argument into a regexp
by jcwren (Prior) on Aug 30, 2000 at 22:04 UTC | |
Re: Turning an argument into a regexp
by le (Friar) on Aug 30, 2000 at 22:04 UTC | |
Re: Turning an argument into a regexp
by ncw (Friar) on Aug 31, 2000 at 01:16 UTC | |
RE: Turning an argument into a regexp
by KM (Priest) on Aug 30, 2000 at 22:10 UTC |
Back to
Seekers of Perl Wisdom