From: Martin Mares Date: Thu, 2 Oct 2008 19:20:54 +0000 (+0200) Subject: When the function called via @f(...) returns anything, it is printed. X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=7a4d124765f6fbcd9395a2bdc4790f91ed6e985e;p=temple.git 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. --- 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;