If I'm reading it right I think you have a small bug: usagedie() if (!-f || !-d); should probably be usagedie() if (!-f && !-d); Otherwise that line will always call usagedie() if passed an argument.
Quite well-written, though. My only nits are that you should validate that the numbers you're passed are actually valid file modes (otherwise they just become 000, which is not what you want), and that you probably don't need to set $opts{directory} since that's not a command-line option.
In reply to Re: How would you go about it?
by Errto
in thread How would you go about it?
by pcassell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |