Could anyone explain me why having perl files like : printf ("<HTML> blahblahb"); printf ("My name is %s",$name);
Is a wrong idea? :-) Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Forestières La Tuque, P.Q. Tel.: (819) 676-8100 X2833 [EMAIL PROTECTED] > -----Original Message----- > From: David R. Baird [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 27, 2004 12:13 PM > To: [EMAIL PROTECTED] > Subject: Re: Handlers vs Perl scripts > > > 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 > > [EMAIL PROTECTED] > > > > > > -- > > 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 > [EMAIL PROTECTED] > 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 > > -- 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