On Thu, 30 May 2002, darren chamberlain wrote:

> Here's a patch to Template::Plugin::XML::RSS; when applied, you can do
> this:
> 
>   [% USE  news = XML.RSS("version", "0.9");
>      CALL news.channel("title", "foo", "link", "bar");
>      CALL news.image("title", "fooimage", "url", "fooimage.gif");
>      CALL news.add_item("title", "item one", "link", "link one");
>      CALL news.add_item("title", "item two", "link", "link two");
>      news.as_string;
>   %]

Very cool.  I played around trying to do the same but avoiding the need 
for all the CALLs (as you worked out, these are normally needed because 
'add_item' and it's friends return values which otherwise would crud up 
your output)

This got really confusing really quick because an rss object has both
a "image" method and hashkey which you need to both access, and the
method is created by an AUTOLOAD.  I was trying to return an 
Template::Plugin::XML::RSS object that delegated to a XML::RSS and then 
returned '' where needed to avoid outputting crud, but I couldn't get all 
the tests to pass.

The problem is I'm not sure what order TT checks for an object's methods / 
AUTOLOAD / hash and I was confusing myself.  For the record, what order 
should this be in?

Later.

Mark.

-- 
s''  Mark Fowler                                     London.pm   Bath.pm
     http://www.twoshortplanks.com/              [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}



Reply via email to