perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David R. Baird" <d...@zerofive.co.uk>
Subject Re: Handlers vs Perl scripts
Date Tue, 27 Jan 2004 17:12:39 GMT
Really, everything you are trying to do is made so much easier in 
Mason. Have you tried the Mason list for help with your bugs? 

Embedding html inside perl scripts is not the way to go - it'll 
get very unwieldy very quickly. 

If you put most of your functions into modules (eg for db 
access), then you can load the modules into your Mason web pages, 
which minimises the amount of perl code in your html. It also 
makes it much easier to debug - you can load the module into a 
test script and check the return values of each function.

Mason makes handling query strings a breeze too. 

d.

On 27 Jan 2004 at 10:54, Hemond, Steve wrote:

> Hi again!
> 
> After taking too much time at debugging my Mason bugs (unsuccessfully)
> , I decided to abandon the idea of embedding perl code in my web
> pages.
> 
> I will setup ONE handler that will only generate a header and a footer
> on each webpage. I'm not at ease with the idea of having a bunch of
> handlers for every dynamic operation and to restart Apache everytime I
> setup a new handler, so I will limit myself to my header/footer
> handler and do the rest in perl scripts.
> 
> My question is : Coding perl scripts like this :
> 
> #!/usr/bin/perl
> 
> print ("<html><head> ...")
> etc...
> 
> is also taking profit of mod_perl? I mean... is that still a good way
> to build mod_perl websites?
> 
> Instead of embedding perl code in html files to generate stuff from a
> database, I would just have to write an entire perl file that will
> print the html code (like the example I've shown above) and do the
> manipulations on the database at the same time. I'm just wondering if
> this is a good idea, or if I am missing the features of mod_perl at
> all.
> 
> If I go with this idea, is there any documentation that shows how to
> handle query strings from a simple perl file?
> 
> Another question : I would need a sub to insert stuff in the database,
> another to extract stuff, another to show date/time, etc. Should I put
> these functions in a simple module that I will include in every perl
> script? 
> 
> Thanks a lot for your help,
> 
> Best regards,
> 
> Steve Hemond
> Programmeur Analyste / Analyst Programmer
> Smurfit-Stone, Ressources Forestieres
> La Tuque, P.Q.
> Tel.: (819) 676-8100 X2833
> shemond@smurfit.com 
> 
> 
> -- 
> Reporting bugs: http://perl.apache.org/bugs/
> Mail list info: http://perl.apache.org/maillist/modperl.html
> List etiquette: http://perl.apache.org/maillist/email-etiquette.html



-- 
Dr. David R. Baird
ZeroFive Web Design
dave@zerofive.co.uk
http://www.zerofive.co.uk

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message