Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: how to avoid using index of array

by Plankton (Vicar)
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

plankton@chumbucket:~$ cat #!/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:~$ ./ boy =[boydog] girl=[girldog] boy =[boymonkey] girl=[girlmonkey] boy =[boy] girl=[girl]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://937799]
[erix]: ah, deciding on the the flight of birds - good idea ;)
[Discipulus]: as good as the Roma foundation
Discipulus we began with a fratricide..
[erix]: ah, Romulus killed Remus. Sad! ;)
erix .oO( does Trump have a brother ? )
[Discipulus]: yes a minor one:
[Discipulus]: Trumpet
Discipulus or is a dog, cat..?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2017-01-20 13:05 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (174 votes). Check out past polls.