use strict; use warnings; my @f = ('/perltest/folder/'); my ($folder, $file); do { $folder = shift @f; opendir(DIR, $folder); while ($file = readdir(DIR)) { next if $file =~ /\.$/; ### Skip . and .. if (-d "$folder$file") { print "$folder$file/ is a directory.\n"; push @f, "$folder$file/"; next; } print "$folder$file is a file.\n"; } } while ($#f != -1);
In reply to Re: finding a subdir
by TJPride
in thread finding a subdir
by surajsam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |