Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: syntax for calling a function

by alexm (Chaplain)
on Jun 27, 2008 at 19:08 UTC ( [id://694434]=note: print w/replies, xml ) Need Help??


in reply to Re: syntax for calling a function
in thread syntax for calling a function

&foo; sub foo { print "Hello\n" }

Don't forget that the following calls are identical:

&foo; &foo(@_); foo(@_);

Therefore, &foo; should be used with care (passing @_ explicitly is much more friendly, IMHO).

Update: chromatic is right, I should've checked perlsub before posting.

Replies are listed 'Best First'.
Re^3: syntax for calling a function
by chromatic (Archbishop) on Jun 27, 2008 at 19:11 UTC
    Don't forget that the following calls are identical:

    They aren't, though. The leading & explicitly bypasses any prototype checking. &foo(@_) may be very different from foo(@_).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2026-01-24 18:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (126 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.