Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Tao Perl Ching - The Scripture of the Way of Perl

by Juerd (Abbot)
on Jan 20, 2005 at 22:02 UTC ( [id://423807]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Tao Perl Ching - The Scripture of the Way of Perl
in thread Tao Perl Ching - The Scripture of the Way of Perl

There are good reasons for many of those things. Vars begins with an upper-case V because vars is a Perl reserved word.

It may be a reason, but it certainly is not a GOOD reason. It's an awful one. If the name you want is taken, then invent another name! Don't find alternative ways to write the same thing for that WILL cause confusion and WILL look ugly.

It is not even true. "vars" is not a reserved Perl word. There is a module called vars, but use is not the context. The context is a sub/method name, and you can without any trouble call that &vars:

use strict; use warnings; sub vars { 1 + 1 } print vars; print main->vars;

I use Params::Validate to normalize the keys, allowing but not requiring the prefixed minus.

The only reason a minus is needed or wanted is wanting to allow a combination of positional and named arguments. Allowing a minus is nice for people who insist on consistent style (but those people should prepare for re-coding CPAN entirely), but IMnsHO it's a waste of CPU cycles to look for them.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-25 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found