Joris,
In my web scripts this is my basic structure.
.CGI script,
This is the control script, basically it dictates the flow of program,
It does nothing else except to dictate what other modules will need to
be called.
Database.pm,
This is my custom module, that makes ALL calls to the database and returns
values or errors depending on what I am looking for, and I not talking just
about Script errors, like for example, if you do a search for one record,
and you cannot find it, it also returns an error complaining that it cannot
find that one record.
Display.pm
This custuom module is responsible for creating my HTML pages, sometimes it
needs to get
data to fill out forms, so it has to make calls to subroutines in the
Database.pm
module to get the data, but otherwise it is just there to create the web
pages.
Standard.pm
This is responsible for all Error checking, validating that the data being
sent is
valid, and making calls to the database to validate data(when necessary) and
updating
the database information.
That is how my basic structure works, for writing web pages, and I think
that it works
fairly well. Though I am a little biased. ;)
Steve K
> -----Original Message-----
> From: Joris Lambrecht [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, March 14, 2001 10:16 AM
> To: activePerl (E-mail)
> Subject: starter : writing real-world perl apps.
>
> For some time now i've been getting to know perl. I think i'm ready to
> start
> writing the stuff i need but i'm not quite sure what's the right approach.
> Main issue i've been wondering about is how to structure the
> code/applications.
>
> For example calling subroutines from an external file/site specific module
> (if possible) or just including the subroutine's into one big script ?
> Does
> anybody know of some read on this ?
>
> Accesing databases with some test-script is easy but implementing this
> into
> a real-world application seems like it has some pitfalls. Any read on this
> would also be of great help.
>
> Thanks,
>
> Joris
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activeperl
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl