in reply to Simple Recursion
Without looking further at your code, I think you will likely need to prepend the current path when checking for the file/directory type and when you call your subroutine recursively:
use File::Spec; ... foreach my $FILE (@LIST) my $FULLFILE = File::Spec->catfile($FILEPATH, $FILE); if(-d $FULLFILE){ #Don't wanna have current directory and the one be +low next if $FILE =~ /^./; #print("Current Directory: $FULLFILE\n"); push(@FILELIST,@{&readin_directory($FULLFILE)}); } ...
Is there a reason you're not using File::Find, which implements mostly what you've done?
|
|---|