Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: The Power of Objects

by Mutant (Priest)
on Jul 29, 2005 at 16:14 UTC ( #479465=note: print w/replies, xml ) Need Help??

in reply to The Power of Objects

Actually, I've discovered my solution above is *wrong*...

The problem is it's entirely reasonable to call a template without calling param(), eg.
my $tmpl = HTML::Template->new( filename => 'template.html' ); $tmpl->output();
Furthermore, param() is called a lot of times internally, behaving differently based on parameter types passed, so it's not trivial to override it.

In the end, I settled on overriding output(), and calling param() from there, setting the variables I needed. I don't think this changes the main point of my post, but I suppose I should use an example that actually works :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://479465]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2016-10-27 15:04 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (365 votes). Check out past polls.