logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

RE: H::T in mod_perl (probably FAQs): msg#00056

lang.perl.modules.html-template

Subject: RE: H::T in mod_perl (probably FAQs)

It should work. The only trick with the "param" function is that if it's
called with no arguments, it should return all the params that it knows
about. I've written quite a few modules that provide a param function and I
then pass those to HTML::Template and they work perfectly.

The way I use H::T in mod_perl is to just do CGI code through
Apache::Registry. In other words, I do the following:
my $cgi = new CGI;
print $cgi->header;
print $template->output;

If you have something that will generate the headers for you, then feel free
to use that. Personally, I like the Apache::Registry way of doing things as
it's very easy to run the same script in a non-mod-perl space. That, in
turn, makes it easy to debug scripts written by people who don't understand
the nuances of mon-perl.

-----Original Message-----
From: Emanuele [mailto:ema_zep@xxxxxxxxx]
Sent: Wednesday, December 10, 2003 6:56 AM
To: html-template-users@xxxxxxxxxxxxxxxxxxxxx
Subject: [htmltmpl] H::T in mod_perl (probably FAQs)


Just some dumb questions by a new HTML::Template-user-wannabe.

1.
My goal is to use the 'associate' H::T option in a "pure" mod_perl
application (i.e. no CGI code handled by Apache::Registry or
Apache::PerlRun.)
Does the following work?

use Apache::Request;
use HTML::Template;
sub handler {
my $r = Apache::Request->instance(shift);
my $template = HTML::Template->new(filename =>
'template.tmpl',
associate => $r);
# some other code
}

Apache::Request has a param() method that behaves much like the one from
CGI.pm query object, so it should work... But unfortunately the only
'associate' example showed in the H::T pod uses (only) CGI, hence my
question.

2.
A more general question(s): how do you use H::T in mod_perl? Just CGI code
through Apache::Registry or you write your own pure
mod_perl(tm) handlers?
If so, do you know/use any (simple) mod_perl framework which could be
considered the pure mod_perl counterpart of CGI::Application? The only one
found so far by me is Apache::PageKit (which does a lot more than
CGI::Application really). It seems good, but I'm always scared to find
myself sooner or later trapped in a too restrictive environment when using
such frameworks. What do you think about PageKit?

Thanks a lot.

Emanuele
(Italy)



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&opÌk
_______________________________________________
Html-template-users mailing list Html-template-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/html-template-users


------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the
designated recipient(s) named above. If you are not the intended recipient of
this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited. This
communication is for information purposes only and should not be regarded as an
offer to sell or as a solicitation of an offer to buy any financial product, an
official confirmation of any transaction, or as an official statement of Lehman
Brothers. Email transmission cannot be guaranteed to be secure or error-free.
Therefore, we do not represent that this information is complete or accurate
and it should not be relied upon as such. All information is subject to change
without notice.



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
krysalis.sandbo...    web.zope.zwiki/...    gnome.apps.gnum...    xfree86.newbie/...    editors.vim/200...    mozilla.enigmai...    boot-loaders.gr...    network.vnc.ult...    redhat.release....    java.geronimo.u...    os.netbsd.devel...    horde.wicked/20...    linux.lsb.discu...    ietf.ips/2005-0...    alsa.devel/2002...    user-groups.lin...    package-managem...    debian.devel.da...    security.cyrus....    video.gstreamer...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation