Chris Newman wrote:
> Yes, I think you are being too pedantic. Use strict, but not
> prototypes. 
> 
> For me, the value of "strict" is that it prevents me from
> accidentally auto-vivifying misspelled variable names.
> Thinking you said $foo = 5, when you really said $foe = 5,
> will introduce insidious bugs that are hard to find.
> 
> For subroutines, I always use the "&" to denote a subroutine
> call, i.e.
> &foo; No prototypes needed. I've grown accustomed to seeing
> &sub, just like I'm accustomed to seeing $scalar, @list, and
> %hash. Also, recursion works with no complaints.

Calling subs with the "&" prefix disables prototype checking, which
isn't really the same thing as "No prototypes needed".

Although strictly speaking optional, it is generally recommended that
subs are called without "&", and for similar reasons for avoiding
prototypes. That is, if you don't need the side effects, and if you
don't know what they are you probably don't need them, you probably
shouldn't use it.

I think using "&" in sub calls marks code as either vintage Perl 4 (or
cargo-cult copying of same - it happens, sadly), or being clever, in
which case the use should be documented.

If I could paraphrase perhaps, the value of not using "&" in sub calls
is that you don't accidentally get bitten by its side effects.

HTH

-- 
Brian Raven
 


-----------------------------------------------------------------------
The information contained in this e-mail is confidential and solely 
for the intended addressee(s). Unauthorised reproduction, disclosure, 
modification, and/or distribution of this email may be unlawful. If you 
have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message 
do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary 
companies.
-----------------------------------------------------------------------


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to