No such thing as a small change | |
PerlMonks |
Re: using an array in a while loopby Anonymous Monk |
on Jan 31, 2022 at 16:38 UTC ( [id://11140996]=note: print w/replies, xml ) | Need Help?? |
Because this is Perl, There Is More Than One Way To Do It. Here is an array-less solution given your statement about how the folders are named: for ( my $i = 1; $i <= 4; $i++ ) { my $dir_name = sprintf 'abc_%03d', $i; chdir $dir_name or die "Unable to change to $dir_name: $!"; ... chdir '..'; } But in real life I would probably use File::Find like everyone else.
In Section
Seekers of Perl Wisdom
|
|