Problem is Im running this script on the Unix server and I don't have permission to install any modules. This is the only way I can think of.... Any other solution? | [reply] |
| [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] |