Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2018-08-17 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (174 votes). Check out past polls.

    Notices?