Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Printing an array using while loop

by perlfan (Vicar)
on Oct 21, 2007 at 22:52 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://646327]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-19 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found