Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Printing an array using while loop

by rminner (Chaplain)
on Oct 21, 2007 at 22:09 UTC ( #646323=note: print w/replies, xml ) Need Help??


in reply to Printing an array using while loop

A for loop can always be written like a while loop
my @array = qw{ball bat helmet}; my $i=0; while ($i<=$#array) { print $array[$i],"\n"; $i++; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2019-08-25 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?