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

I am using File::Find to cruise around and find zip files and extract the files in Windows NT.
find(\&unzipfiles, $ARGV[0]);
I want to pass a $var to my unzipfiles routine like this:
find(\&unzipfiles($var), $ARGV[0]);
When I do, I get an error message like this: Not a CODE reference at Find.pm line 450

Replies are listed 'Best First'.
Re: pass value to sub
by dragonchild (Archbishop) on May 17, 2005 at 19:05 UTC
    find( sub { unzipfiles( $var ) }, $ARGV[0] );

    • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
    • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"