Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: defining variables using my - subroutines

by NetWallah (Abbot)
on Sep 05, 2012 at 15:52 UTC ( #991882=note: print w/replies, xml ) Need Help??


in reply to defining variables using my - subroutines

my ($generated_array_ref, $generated_var) = Generator(); Second_sub_receives_array_ref( $generated_array_ref, $generated_var); sub Generator{ my $localvar=33; return ([0..50], # Generated array ref $localvar); } sub Second_sub_receives_array_ref{ my ($rcvd_arrayref, $rcvd_var) = @_; for (@$rcvd_arrayref){ # array element is available as $_ } }
UNTESTED.

             I hope life isn't a big joke, because I don't get it.
                   -SNL

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991882]
help
Chatterbox?
[Corion]: (or how/where to patch AnyEvent::HTTP or LWP::UserAgent to take control of both the callstack and the data transfer)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2016-12-08 09:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (137 votes). Check out past polls.