Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Warning for "unused sub declarations"?

by chas (Priest)
on May 20, 2005 at 00:49 UTC ( [id://458832]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Warning for "unused sub declarations"?
in thread Warning for "unused sub declarations"?

Reasonable question! I don't know enough about how the parsing/compiling takes place to say. But I suppose it may save some time (i.e. decrease the number of passes) if it is not necessary to look ahead for sub defs. I'll bet someone else around here knows, though. BTW, I usually do like you do and put sub defs at the end (and call with &.) My previous response was just an answer to why someone might declare subs before using; I used to predeclare, but lately it seems more organized to have all the subs defined/declared in just one place (and that outweighs the disadvantages most of the time.)
chas
  • Comment on Re^4: Warning for "unused sub declarations"?

Replies are listed 'Best First'.
Re^5: Warning for "unused sub declarations"?
by blazar (Canon) on May 20, 2005 at 07:31 UTC
    BTW, I usually do like you do and put sub defs at the end (and call with &.)
    Sorry for the repetition, but repetita iuvant. You can put your sub defs wherever you want. But you should never ever call them with & unless you know what you're doing. perlsub will explain you why far better than I could.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-16 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found