]> mj.ucw.cz Git - temple.git/commitdiff
When the function called via @f(...) returns anything, it is printed.
authorMartin Mares <mj@ucw.cz>
Thu, 2 Oct 2008 19:20:54 +0000 (21:20 +0200)
committerMartin Mares <mj@ucw.cz>
Thu, 2 Oct 2008 19:20:54 +0000 (21:20 +0200)
Beware, this is an incompatible change!

All built-in functions have been updated to return undef.

UCW/Temple.pm

index 32453daf1daaab9a70db2ecb095ba17d6db81249..572bc2547597872a289ffdaad68ebafb4fddecf6 100644 (file)
@@ -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;