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: New Template Object based on Existing one: msg#00004

lang.perl.modules.html-template

Subject: Re: New Template Object based on Existing one



Roger Burton West wrote:

> I haven't tried this, but my first reaction is to use the usual syntax
> for interrogating a template:
>
> $content2->param($content->param);

Sébastien Aperghis-Tramoni wrote:

> It's even simpler: simply associate the first object with the second.

> #!/usr/bin/perl
> use HTML::Template;

> my $tmpl = new HTML::Template filehandle => \*DATA;
> $tmpl->param(foo => "bar");
> print $tmpl->output;

> my $str = "Second template: foo = <TMPL_VAR NAME=foo>\n";
> my $copy = new HTML::Template scalarref => \$str, associate => $tmpl;
> print $copy->output;

Thanks for the suggestions guys, I tried both ways and I got different
results with each.

That "associate" seemed like the way to go, when I tried that I get the H:T
error
"attempt to set parameter 'items_loop' with a scalar - parameter is not a
TMPL_VAR!"

When I tried the "$content2->param($content->param);" method - I'm not
really sure what happened, it failed when trying to set a tmpl_var that was
the "else" in $content, but $content already contained the flag to mark that
value true, plus it seemed to process forever, it took about 2 mins..

I'm going to keep experimenting and see if I can get something to work, if
you have any other idea, I'd love to hear them.

Thanks
-Chris








-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn


<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