[Phoenix-pm] poll: top or bottom?

Scott Walters scott at illogics.org
Fri Apr 7 17:48:12 PDT 2006


In the middle, via closures.  

On  0, Corey Saltiel <corey_s at streamreel.com> wrote:
> 
> Where do you guys place your subroutines in scripts?
> 
> And what do you usually prefer to call the subroutine that kicks things off, 
> i.e. 'main()', 'begin()'?
> 
> I've always put my subroutines at the top, right after the basic setup logic
> ( declaring pragmas and modules, and whatever global vars, etc ), then I 
> throw  the call  to the entering/main subroutine at the very bottom of the
> script, underneath the subroutines -- but I tend to be switch between 
> calling the entering subroutine either: main() or begin() - out of sheer 
> indecision. 
> 
> Like so:
> 
> #!/usr/bin/perl
> use warnings;
> use strict;
> 
> use ACME;
> use Blah;
> 
> my ( $globals, $go, $here ); # minimal or non-existant
> 
> $globals = '';
> 
> $go = '';
> 
> $here = ''
> 
> 
> sub foo { }
> 
> sub bar { }
> 
> sub snafu {}
> 
> sub begin {}
> 
> 
> begin();
> 
> 
> Anyhow, just curious!  Obviously mostly a matter of subjective opinion, but
> interesting none-the-less.
> 
> 
> Beers,
> 
> Corey
> _______________________________________________
> Phoenix-pm mailing list
> Phoenix-pm at pm.org
> http://mail.pm.org/mailman/listinfo/phoenix-pm


More information about the Phoenix-pm mailing list