Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: A question of style

by ZZamboni (Curate)
on Aug 23, 2000 at 03:03 UTC ( #29130=note: print w/ replies, xml ) Need Help??


in reply to A question of style

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


Comment on Re: A question of style
RE (tilly) 2: A question of style
by tilly (Archbishop) on Aug 23, 2000 at 03:53 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2015-07-03 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (56 votes), past polls