On Tue, 9 Nov 2004, Edward WIJAYA wrote:

> Would like to know, where is the best place to
> put collection of subroutines in a Perl program,
> is it after "main" or before? Any caveat?
 
It's more a matter of style than anything else.

I like having the main block up front, and the subroutines after. Better 
still, if the subroutines might be useful to more than one script, they 
should be moved into separate files and called as libraries. That both 
shrinks the initial program (sort of...) and fosters reuse. 

But Perl doesn't really impose any one style here.

 

-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to