Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 chilling in the Monastery: (20)
As of 2014-07-24 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (162 votes), past polls