i didnt use GetOpt, becuase i only have a few command line options to read in and didnt really see the need for using a separate module to do what i could do in ~8 lines of perl code... if i add anymore options in the future, i'll probably end up using GetOpt.
i dont intend this to be a replacement for unix 'chmod' either, but rather a tool to enhance the functionality of chmod, by allowing a bit more control over what gets chmodded. it allows the user to chmod an arbitrary number of files to an arbitrary number of modes all at one time (instead of chmodding all directories to 755, then chmod 644 -R *, then chmod 755 *.pl *.sh *.cgi, etc... everytime a directory tree needs to have permissions set)
the biggest difference between (pchmod.pl -r) and (chmod {mode} -R *) is that this will differentiate between files of certain types and directories, rather than mindlessly chmod *everything* in the tree to one mode. all hell breaks loose here when someone accidentally chmod's a directory on the webserver to 644 and apache spews out Forbidden errors... :)
it's also good for people that have a hard time remembering the syntax for chmod or aren't too familiar with linux... you can just add the necessary options into the %cfg hash and tell the person to type (pchmod -csomeconfig) and it'll set things the way you specified in the %cfg hash, instead of the person remembering the octal codes and such...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.