++tamills and ++LordAvatar for their helpful tips. In particular, tamills's advice should produce a massive performance boost, because in your code, @files = (@files,$_); is essentially replacing the entire contents of @files with its prior contents plus a new element, EVERY TIME you add to it.
The time it takes to add a new element this way increases exponentially with the number of elements in the array, versus push which runs in approximately constant time.
Mustn't forget the, ahem, obligatory standard advice:
As a rule, put -w on your shebang line, and use strict;, and take the time to remove any errors or warnings reported.
#!/usr/bin/perl -w use strict; use File::Recurse; # ...
BTW, subroutine calls no longer require the & prefix character. Using them makes your code unnecessarily more difficult to read.
Update: fiddled with text.
dmm
You can give a man a fish and feed him for a day ...In reply to Re: recurse directory script
by dmmiller2k
in thread recurse directory script
by CHRYSt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |