Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: how to avoid using index of array

by Plankton (Priest)
on Nov 13, 2011 at 06:34 UTC ( #937799=note: print w/ replies, xml ) Need Help??


in reply to how to avoid using index of array

Stacks?

plankton@chumbucket:~$ cat stack.pl #!/usr/bin/perl -w use strict; my @boys = qw/boy boymonkey boydog/; my @girls = qw/girl girlmonkey girldog/; while (@boys){ # will be boys my $boy = pop( @boys ); my $girl = pop( @girls ); print "boy =[$boy] girl=[$girl]\n"; } plankton@chumbucket:~$ ./stack.pl boy =[boydog] girl=[girldog] boy =[boymonkey] girl=[girlmonkey] boy =[boy] girl=[girl]


Comment on Re: how to avoid using index of array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-08-29 20:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls