Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 surveying the Monastery: (4)
As of 2019-08-24 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?