in reply to Require input reading files recursively in perl
General disclaimer: use strict/warnings.
Using a global filehandle (or in general any global variable that can be modified) with recursion is a *bad* idea. Instead use lexcials:
Don't forget to closedir when done.opendir(my $SCR , $dir) or die "Can't open $dir: $!"; while( defined (my $file = readdir $SCR) )
In Section
Seekers of Perl Wisdom