Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: using an array in a while loop

by choroba (Cardinal)
on Jan 31, 2022 at 09:47 UTC ( #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? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2023-03-30 01:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (73 votes). Check out past polls.

    Notices?