Hi,

Am using find method in File::Find module.
Right now this method is being used as follows:
      find({wanted => \&find_and_instantiate_commav_file,
                 no_chdir => 0},
                 $spec_entry);

But I want to pass another parameter to find_and_instantiate_commav_file subroutine. I tried,
    find({wanted => \&find_and_instantiate_commav_file("some_value"),
                 no_chdir => 0},
                 $spec_entry);

And the sub routine is as follows:

sub find_and_instantiate_commav_file() {

   my $slave_path = shift;
*LINENO:* if ( /,v$/ )
    {
        // do something
    }
}

This fails with,
Use of uninitialized value in pattern match (m//) at ...*LINENO*
Not a CODE reference at /usr/local/oracle/perl/5.8.1/lib/File/Find.pm line 792.

Can anyone let me know how to pass parameters to subroutine refernced in find method and how to
access these within the subroutine.

--
Shobha Deepthi V
The statement below is true.
The statement above is false.




Reply via email to