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
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.
| [reply] |
|