Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: why avoid & on function call (pre-declaration)

by Bod (Parson)
on Dec 27, 2020 at 19:54 UTC ( [id://11125818]=note: print w/replies, xml ) Need Help??


in reply to Re^2: why avoid & on function call (pre-declaration)
in thread why avoid & on function call

A pre-declaration placeholder can be done by a body-less sub NAME;

Thanks LanX - I didn't know this was an option. Although in the past I have habitually added an ampersand which I have been doing less and less over the last year or so in favour of always applying parenthesis. So I don't envisage me using this pre-declaration very much but it's good to know it exists.

Replies are listed 'Best First'.
Re^4: why avoid & on function call (pre-declaration)
by LanX (Saint) on Dec 27, 2020 at 20:02 UTC
    > So I don't envisage me using this pre-declaration very much but it's good to know it exists.

    There are use cases, like plugin systems or delayed compilation on demand.

    NB: prototypes can be pre-declared too, so just applying parenthesis instead of ampersand wouldn't help, if you want an explicit prototype check.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-04-23 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found