Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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: (3)
As of 2018-12-11 01:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (52 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!