Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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


Comment on Re: defining variables using my - subroutines
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-11-20 23:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (103 votes), past polls