I\'m trying to traverse through all the subdirectories of the current directory in Perl, and get data from those files. I\'m using grep to get a list of all files and folder
my $dh = opendir("."); my @entries = grep !/^\.\.?$/, readdir($dh); closedir $dh; foreach my $entry (@entries) { if(-f $entry) { # $entry is a file } elsif (-d $entry) { # $entry is a directory } }