[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgi-list
Subject:    Re: [CGI] Probably simple ...
From:       "Peter J. Schoenster" <webmaster () rede ! com>
Date:       2000-09-30 21:00:19
[Download RAW message or body]

On 29 Sep 2000, at 18:30, Paul Ellsworth wrote:

> I would like to know how I can break up (a) script(s) so they
> aren't all in one file.  I know it has something to do with
> "require", but as to how you use that keyword and how you write
> the other files so they can be "required" (do they still have to
> have the #! line, etc), I have no idea.  In fact, all I know is
> that it has something to do with they keyword "require."

I do that to a large degee. I use modules. As one thing I nearly 
always do is work with a rdbms and cgi I have a few personal 
modules of common subroutines that I am always using. I also 
have a personal date/html module that builds all sorts of 
date/html combinations.  I don't dare make this stuff public as 
I want to keep my job:):) (in that too many complaints might be 
made to my bosses:) ... but I've found the idea a good one. One 
of the first books I read on cgi/programming/perl was the 
"Webmasters Handbook" and nearly every script in the book had 
everything in subroutines. I found that a good idea. Simply put, 
a module is just a collection of subroutines that are related in 
some way.

Don't go and use require ... as in the cgi-lib.pl thing. Look 
into the use of modules. I think you will find your time well 
rewarded.

Peter

__________________________________
Exercise Your Brain, Read a Book
-- O Crazy Gringo, Ipanema, Brazil
-----------------------------------------------------------------
To unsubscribe, send mail to "majordomo@jann.com" with "unsubscribe cgi-list"
in the body.

CalendarPlus v3.0 with JavaPlus is available NOW!
http://www.calendarplus.com/

The CGI Tips & Tricks website (and archive of the list) is located
at http://perl.jann.com/
-----------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic