in reply to How to extract Req files into some other directory using Modules

Two things. The regexp is using shell wildcarding instead of perl wildcarding, which when fixed would be:
$name = "(\.dll|\.exe)\$";
and the regexp needs to be delimited where it is used rather than in the variable, i.e.
$try =~ /$name/;

One world, one people

Replies are listed 'Best First'.
Re^2: How to extract Req files into some other directory using Modules
by blazar (Canon) on Aug 03, 2005 at 10:38 UTC
    $name = "(\.dll|\.exe)\$";
    As a minor point, I wouldn't use capturing parens where not needed, I'd write
    my $name = qr/\.(?:dll|exe)$/;
    instead. And as you can see from this line itself, I wouldn't put into a string to interpolate it later, but I would create Regex object, especially since it isn't supposed to change. But then I wouldn't probably create any intermediate variable, in this case, that is:
    find sub { push @files, $_ if /\.(?:dll|exe)$/ }, @dirs;