Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: using an array in a while loop

by choroba (Cardinal)
on Jan 31, 2022 at 09:47 UTC ( [id://11140990]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @dirs = ('/path/to/dir1', '/some/other/path/to/dir2', '/dir3');
    for my $dir (@dirs) {
        ...
    }
    
  2. or download this
    my @dirs = map { sprintf 'abc_%03d', $_ } 1 .. 100;
    
  3. or download this
    for my $i (0 .. $#dirs) {
        my $dir = $dirs[$i];
        ...
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found