Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: return data from a subroutine reference...

by bobf (Monsignor)
on Aug 12, 2006 at 07:43 UTC ( [id://567011]=note: print w/replies, xml ) Need Help??


in reply to return data from a subroutine reference...

$arch{$type}->("some stuff") simply calls the subroutine (see perlref), so you can capture the return value from it just as you would any other subroutine:

my $retval = $arch{$type}->("some stuff");

Update: You may also find Implementing Dispatch Tables helpful (from our Tutorials section).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://567011]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found