On Fri, 14 May 2004, Andy Wardley wrote:
> You could do this instead:
>
> $input = $context->insert($input) unless $input =~ /</;
>
> The $context->insert($filename) does the job of finding the file
> in the INCLUDE_PATH and returning the content.
Darn you and super-flexible templating system. How am I supposed to write
any perl code around here ;-)
And darn me for not having the badger book to hand when trying to write TT
patches :-)
FWIW, here's an amended patch...
Simon.
--
"Time is an illusion, lunchtime doubly so"
--- Simple.orig 2004-05-14 12:58:52.000000000 +0100
+++ Simple.pm 2004-05-14 15:20:10.000000000 +0100
@@ -44,6 +44,8 @@
my $input = shift;
my $args = ref $_[-1] eq 'HASH' ? pop(@_) : { };
+ $input = $context->insert($input) unless ( $input =~ /</ );
+
XMLin($input, %$args);
}