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) )
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Require input reading files recursively in perl
by jesuashok (Curate) on Apr 17, 2013 at 13:28 UTC |
In Section
Seekers of Perl Wisdom