From 5ea54bc61b77141c3b8d33dd9282d9415faf4817 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 12 Aug 2015 12:20:33 +0200 Subject: [PATCH] Added "set" function for setting of template variables from outside This is basically an easy way to get around strictness warnings. --- UCW/Temple.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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($) { -- 2.39.2