Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Printing an array using while loop

by perlfan (Curate)
on Oct 21, 2007 at 22:52 UTC ( #646327=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @array1 = qw/ball bat helmet/;
    while (@array1) {
    ...
      print $item;
      push(@array2,$item);
    }
    
  2. or download this
    my @array1 = qw/ball bat helmet/;
    while (@array1) {
      print pop @array1;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2019-09-19 12:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (243 votes). Check out past polls.

    Notices?