Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: "Is it a hashref" vs "Can I use it like a hashref?"

by stvn (Monsignor)
on Jan 20, 2004 at 02:53 UTC ( [id://322506]=note: print w/replies, xml ) Need Help??


in reply to "Is it a hashref" vs "Can I use it like a hashref?"

IMHO, if HTML::Template were to allow such a wide open definition of what it accepts, it would be a support nightmare. Accepting every tied and overloaded data-structure would certainly degrade performance for plain old everyday hash-refs.

Personally, I think HTML::Template is fine as it is. It's very stable, extremly usable and has a simple and well defined API/interface. Subclass it if you want it to do these things.

I actually think your argument is more with tie than it is with HTML::Template. ( Overloading the %{} operator still requires you to return a hash-ref. If you dont want to return a real hash-ref, then it needs to be a tied hash-ref (see the overload doc for more info) ) What I think you really want is for tie to say "i am a hash" rather than "you can treat me like a hash". But to be honest, I am not a fan of that approach though.

-stvn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-24 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found