At 7:37 PM -0600 3/16/02, Puneet Kishor wrote: >I have one index.pl (this is a web app), and everything passes >through this. So, if the call is to index.pl?do=login then the login >page is included, if the call is to index.pl?do=verify then the >verify page is included. This is how I work in the world of other >web programming (Cold Fusion, PHP, etc.).
I've never understood why I see so much Coldfusion code doing it this way. Coming in and debugging other people's code I find it very difficult to figure out what is getting executed when with this model. Using Embperl's EmbperlObject model you could do this automatically in a readable fashion. Loading "login" would wrap it in a top-level template automatically. Or alternatively you could have "login.html" include "index.pl" and then call the appropriate routines at the appropriate places. The other big advantage you'll get using a package like HTML::Embperl over doing it yourself with .pl files is caching. The perl files will get compiled once, and then the code will be reused. You also don't have to worry about cross-site scripting security issues, since Embperl always escapes user's input appropriately for the context. >-- is there anything wrong with coveting embperl, any downsides? Are >there other ways of doing things? After several years using my own embedded perl scripting solution I took a close look at Mason and Embperl and went with Embperl. It's been several years more now, and with the XML support being added in Embperl 2.0, I'm feeling very good about that solution. Other's might prefer Mason. But I would definitely recommend either package over straight CGI and home-brew templates. -- Kee Hinckley - Somewhere.Com, LLC http://consulting.somewhere.com/ [EMAIL PROTECTED] I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's.