Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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 ( 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.

Replies are listed 'Best First'.
Re: Anonymous subroutine
by Anonymous Monk on Mar 14, 2011 at 19:29 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://893114]
Approved by philipbailey
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2018-05-26 03:27 GMT
Find Nodes?
    Voting Booth?