in reply to Re: where do you put your subs
in thread where do you put your subs
The subs are all black boxes (mostly, except where they use the package globals), which means (in my mind) it shouldn't make the slightest bit of difference where they appear in code order. They aren't executed "in order" so order becomes immaterial.use statements my $foo; # LOOK I'M A PACKAGE GLOBAL WOO HOO! main loop/program logic subs
But you know, that's what makes sense to me. Some people are completely allergic to () so they declare their subs first. I don't mind typing "foo()" so I don't care. If you don't like globals (and want to go whatever means necesary to keep from using them, either on purpose or accidentally) hey, more power to ya. I think they're kinda spiffy, and my code is brutally consistent as to how and when I declare them and use them.
All in all I think perlstyle is silent on this because it really is a matter of taste, and TMTOWTDI.
Perhaps next we'll discuss proper tab indentation. :-D
Gary Blackburn
Trained Killer
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: where do you put your subs
by demerphq (Chancellor) on Mar 08, 2002 at 13:33 UTC | |
by Trimbach (Curate) on Mar 08, 2002 at 15:24 UTC | |
by Juerd (Abbot) on Mar 08, 2002 at 16:04 UTC | |
by Trimbach (Curate) on Mar 08, 2002 at 16:16 UTC |