[Templates] Accessing hash elements in a tied hash-object

[prev] [thread] [next] [Date index for 2005/04/12]

From: Trond Michelsen
Subject: [Templates] Accessing hash elements in a tied hash-object
Date: 11:20 on 12 Apr 2005
Hi.

Is it possible to access hash elements of an object which is also a
tied hash?

I have an object like this that I want to use in a TT template, and I
get an error if I try to access the hash elements in the usual
manner. 

  undef error - Can't locate auto/mapscript/imageObj/imagepath.al in
  @INC (@INC contains: [...])
  at /usr/local/share/perl/5.6.1/Template/Stash.pm line 650

FETCH() and STORE() are just wrappers around functions called
swig_${key}_get and swig_${key}_set(), so I don't _have_ to access the
object as a hash. It'd just be nice to be able to reduce the general
uglyness the swig_*_[gs]et methods causes.

        -- 
        Trond Michelsen

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Accessing hash elements in a tied hash-object
Trond Michelsen 11:20 on 12 Apr 2005

Generated at 09:31 on 27 Apr 2005 by mariachi v0.52