[Templates] Patch for 2.0-beta2

Andy Wardley abw@cre.canon.co.uk
Tue, 1 Aug 2000 15:26:11 +0100


>* Adds RECURSION option checking into Context.pm, recursive templates
>  work again.

Great!

>* Added use overload q|""| => "as_string"; (to stringify) to
>  Exception.pm, so that fatal death does not cause a mysterious error
>  about HASH(0x...)

Excellent!

>* Added require Template::Iterator; to the eval for compiled templates,
>  otherwise Iterators and such do die with a "'Can\'t locate object
>  method 'new'..." exception.

Ah yes, Doug caught that one already, but thanks anyway.

>* Changed:
>-    elsif (UNIVERSAL::isa($root, 'UNIVERSAL')) {
>+    elsif (UNIVERSAL::can($root, $item)) {

The only problem with this is that it doesn't allow AUTOLOAD methods
to work.  I've already had to change this line (several times in fact!)
to work around a problem with CGI which returns false when asked
isa('UNIVERSAL') on the second or subsequent calls.  The current test
is UNIVERSAL::can($root, 'can') which seems to work OK, even though it
is a little contrived.

Thanks for the patch.


A

-- 
Andy Wardley <abw@kfs.org>   Signature regenerating.  Please remain seated.
     <abw@cre.canon.co.uk>   For a good time: http://www.kfs.org/~abw/