From 7a4d124765f6fbcd9395a2bdc4790f91ed6e985e Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 2 Oct 2008 21:20:54 +0200 Subject: [PATCH] When the function called via @f(...) returns anything, it is printed. Beware, this is an incompatible change! All built-in functions have been updated to return undef. --- UCW/Temple.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UCW/Temple.pm b/UCW/Temple.pm index 32453da..572bc25 100644 --- a/UCW/Temple.pm +++ b/UCW/Temple.pm @@ -72,7 +72,8 @@ sub eval_func($$) { } # print "Cond stack: @cond\n"; } else { - eval_if_ok("$f($a)"); + my $res = eval_if_ok("$f($a)"); + print $res if defined $res; } } @@ -160,12 +161,14 @@ sub include { UCW::Temple::eval_if_ok("\$$v = \$temp"); } UCW::Temple::parse_file($fn); + return; } sub load { my $f = shift @_; (!defined($f) || @_) and die "\@load requires only one argument"; require $f; + return; } 1; -- 2.39.5