in reply to Re: Script Critique
in thread Script Critique
Where does @results get set? Nothing in the main line code indicates that. Setting global variables as a side effect of calling code is bad!
He doesn't control File::Find's interface. He has to use a global unless he wishes to mix his input, processing and output into the find callback, something I wouldn't do. However, inlining the function makes things appear more local.
my @results; find( sub { ... push @results, ...; }, $dir );
Update: That's one of the reasons I prefer File::Find::Rule.
|
|---|