File::Find is a core module going back to Perl 5.0. If you're running any version of Perl 5, then you have it.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
| [reply] |
I really like File::Finder for doing things like this.
As for not being able to install modules you can usually install the module source in your own directory. To install File::Finder you could do the following.
Create a directory named File in the same directory as your script is in.
Download the Finder.pm file from the CPAN link above. (There is a link named "Source" near the top of the page that explains the module.) Save this file in the File directory
At this point you should have a file tree something like:
/home/work/myscript.pl
/home/work/File/Finder.pm
Now when you run your script it should look in the current directory for the modules in addition to the system directories.
| [reply] [d/l] [select] |
If you're doing this on a unix machine, you don't need perl at all. While File::Find is part of the Perl "core", it is noticeably slower than the unix-native "find" utility. All you need is a unix command line like this:
find /cdw/home_dir/s006258/CSPAM -name '*.sas' -print0 | xargs -0 chmo
+d 644
Note the single-quotes around the '*.sas', to keep the asterisk from being "interpreted" by the shell.
Perl is great, but for little things like this, the shell can be better. | [reply] [d/l] |