From: Nikola Janceski <[EMAIL PROTECTED]> > This question is more for the gurus. It's about etiquette and style. I > realize now the benefits of following coding standards and etiquette, > and of course use warnings and use strict. > > My question lies in the & when calling a subroutine. Should those who > are starting out use &function(); or function(); ??
Definitely function(); There are two reasons. 1. the & turns off the prototypes completely 2. it's easy to fall into the &function; trap : &function; DOESN'T mean function(); # which is the same as: function; BUT function(@_); And besides, if the docs say &function(...) is deprecated, I do believe them. > I am also seeing the benefits of using prototypes when declaring my > functions. No more worries of having to put the \ on the correct > arguments when calling my wacky functions that take 2 refs and 3 > scalars. Are prototypes recommended for easy maintenance? Or do they > just get in the way and confuse others? I think the general concensus is .. don't use prototypes unless you have to. Most people doesn't understand them correctly, it's harder to guess what is going to happen if you look at the function calls etc. > Oh and how do you declare a > subroutine with a prototype for NO arguments? sub foo () {...} Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]