Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How would you go about it?

by Errto (Vicar)
on Jul 26, 2004 at 01:58 UTC ( [id://377335]=note: print w/replies, xml ) Need Help??


in reply to How would you go about it?

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.

Replies are listed 'Best First'.
Re^2: How would you go about it?
by pcassell (Sexton) on Jul 26, 2004 at 18:35 UTC
    Yes you are completely right, I got mixed up because originally I was using unless statements instead of negated if statements, but I'm used to using if (!exp) so I changed it and it got lost in the conversion. Thanks for pointing that out.

    I will look into validating octals thanks ya'll.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://377335]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-20 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found