Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Answer: Will recursive code update data in an array?

by arturo (Vicar)
on Apr 25, 2001 at 01:13 UTC ( #75269=categorized answer: print w/replies, xml ) Need Help??

Q&A > arrays > Will recursive code update data in an array? - Answer contributed by arturo

If the array has wider scope than the subroutine, then yes. Unrealistic sample follows:

my @array = (); my $counter =0; recurse(); sub recurse { push @array, $counter++; return if $counter > 25; recurse(); }

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2018-10-18 03:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (99 votes). Check out past polls.

    Notices?