On 5/22/06, Robert Hicks <suppressed> wrote:
In looking at your source there (cool by the way) a question came to mind. The template is stored in the __DATA__ section. Is that your standard practice? Is it only because it is one page/template or does the Ajax integration need it that way?
It is definitely not my standard practice. I do it that way in
example scripts sometimes so that all the information is in one
location, and since this is an example for a programmer, it is easiest
to just include the template in the __DATA__ section. I find it makes
it easier to follow the example without having to jump around
different files.
You may notice that in some of the examples I also use the CGI.pm
library to generate HTML for me. This is also not something I often
do, except in example scripts. I can write them fairly quickly that
way, and it keeps the template stuff out of the way, when it is not
important for the example. (and I loathe putting HTML directly in the
perl code, so using the CGI.pm library makes me feel a little bit
better about sticking HTML in my code ;) )
If I built all the example scripts the way I usually build my
applications, then the actual idea I am trying to show/explain would
have a tendency to get lost in the noise. You would end up with an
instance script, a base CGIApp module, the real CGIApp module, a
header and footer to wrap my templates, the actual template, etc...
Cheers,
Cees
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.