use File::chmod;
while (<>) {
close ARGV;
chmod "u+x", $ARGV if /^#!/ and not -x $ARGV;
}
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply. | [reply] [d/l] |
Thank you for pointing out File::chmod. I didn't bother to search CPAN at the time because it was just a quick script.
| [reply] |
I didn't bother to search CPAN at the time because it was just a quick script.
One of the keys to writing a quick script quicker is to write less of it. Get familiar with interesting CPAN modules, and have them installed.
Most of my columns are merely wrappers around good CPAN modules. So, I write a dozen lines of code, and call hundreds of lines of previously tested code. That's good leverage. (I even wrote a column about that. {grin})
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
| [reply] |
I have found that sometime scripts are purposely made not executable may be to avoid accidental running as they are meant to be run from cron or some other ways. So it is done not as a security mesaure but as a precautionary measure.
artist | [reply] |
I agree that sometimes that is true and is a good precaution, but in my case, the scripts weren't marked executable because they were copied over from a Windows machine which doesn't preserve the permission bits.
| [reply] |