Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: A question of styleby ZZamboni (Curate) |
on Aug 23, 2000 at 03:03 UTC ( [id://29130]=note: print w/replies, xml ) | Need Help?? |
I think it's entirely a matter of personal taste. I also try
to avoid the ampersand whenever possible, using parenthesis after
its name (empty if there are no arguments) to make it clear
that it's a function call. There is at least one case, though, in which the ampersand has a very specific use: if you write "&func" (this is, with ampersand and without parenthesis) the function will be called with the contents of @_ as arguments. I don't know where this is documented; I learned it from Conway's OO-perl book. Other uses for the ampersand include de-referencing code references. --ZZamboni
In Section
Seekers of Perl Wisdom
|
|