opendir(ROOT,'/web/web1/') or die "Can't open directory; @my_names = readdir(ROOT); # do a filetest(-d on each element of @my_names, # you can check directories thusly foreach my $elem(@my_names) { if(-d $elem) { # yup, its a directory } # push it onto a stack, for later processing else { # file, symlink.. so, check if its the file you
want to process... and do stuff with it, or let it alone } }