Hi Jeff,

Thanks for your help. That really worked!

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






Jeff 'japhy' Pinyan wrote:

On Jul 7, Shobha Deepthi said:

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);


The syntax

  \&function

returns a reference to a function.  But the syntax

  \&function(...)

returns a reference to the RETURN value of function() called with whatever args you've given it. What you want to do is:

  find({
    wanted => sub { find_and_instantiate_commav_file("some_value") },
    no_chdir => 0,
  }, $spec_entry);

Here, we create an anonymous function (sub { ... }) and use it. This anonymous function, when called, just calls the find_...(...) function.

Reply via email to