Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Foreach Loops

by hubb0r (Pilgrim)
on Mar 15, 2005 at 18:56 UTC ( #439714=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foreach my $line (@arr) {
       ## stuff goes here;
    }
    
  2. or download this
    for (my $x = 0; $x < $#arr; $x++) {
        my $line = $arr[$x];
        ##  stuff goes here;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://439714]
Approved by Tanktalus
Front-paged by davidj
help
Chatterbox?
[LanX]: shmem: but only because it is taught in school
LanX remembers one curriculum about benny and the punishment whe we didn't laugh ...hill
LanX horror
[Discipulus]: in case of doubt freedom
[LanX]: consideration is a democratic process

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2017-04-27 20:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (513 votes). Check out past polls.