Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Anonymous subroutine

by rpike (Scribe)
on Mar 14, 2011 at 19:13 UTC ( #893114=perlquestion: print w/ replies, xml ) Need Help??
rpike has asked for the wisdom of the Perl Monks concerning the following question:

This is a CGI Perl application. Components I have are main script (main.pl) and a module I import at the top of the script (use somemodule;). I call a subroutine within the module, passing it all the parameters it needs. In the main script I create an anonymous subroutine and pass it to a subroutine within the module such as :
$anonyFunc = sub { my ($aFirst, $aLast, ....) = @_; }; ... somemodule::subname(..... , $anonyFunc.......);
In the subroutine I call I then try using the subroutine that was passed such as :
$passedFunction->($firstParm $secondParm,.....);
When I run my application and leave out the above line of the call to the anonymous function passed it does everything and finished (except what's in the anonymous function of course). If I include that line the CGI application just returns with a blank page. I can't post the source code but was hoping someone has experienced this before and what is the normal, typical cause of an anoymous function like this not to work? Is there something I can put in the code to help debug it? Any help would be appreciated. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://893114]
Approved by philipbailey
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (15)
As of 2014-07-29 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (217 votes), past polls