Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Consider the case where you usually want to validate something (eg whether a user has permission to access a file) for the current user, but sometimes for some other user, like in File::Find::Rule::Permissions [].

    This means that at least sometimes you have to pass in that parameter. For the sake of making the parameter list easier to parse, or to avoid confusing maintenance programmers by having the same method take two different forms of its arguments, I think I would at least consider always passing in the username.

    I prefer to pass a hash of parameters thus faking up named parameters. That avoids both of the problems above. But using named parameters is a coding style choice that might not suit all cases.