From: Martin Mares Date: Wed, 12 Aug 2015 10:20:33 +0000 (+0200) Subject: Added "set" function for setting of template variables from outside X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=5ea54bc61b77141c3b8d33dd9282d9415faf4817;p=temple.git Added "set" function for setting of template variables from outside This is basically an easy way to get around strictness warnings. --- diff --git a/UCW/Temple.pm b/UCW/Temple.pm index e1a21e3..ad4f021 100644 --- a/UCW/Temple.pm +++ b/UCW/Temple.pm @@ -11,7 +11,7 @@ require Exporter; our $VERSION = 1.0; our @ISA = qw(Exporter); our @EXPORT = qw(out); -our @EXPORT_OK = qw(); +our @EXPORT_OK = qw(set); use IO::File; @@ -23,6 +23,13 @@ sub out { return; } +sub set { + my ($var, $val) = @_; + $var = "T::$var"; + no strict 'refs'; + $$var = $val; +} + our %deps = (); sub add_depend($) {