This is because your code overwrites '$vars' after setting those values.
To correct it, set all of them at the same time:
There is nothing wrong with setting the values individually (Except for negligible performance). Just don't overwrite the variable after setting the values.my $vars = { title=> = 'Template Test' , site_name => 'TEST Home Page', header => { date => 'Jan 1, 2008', author => 'Me, myself and I', }, row => [ { first => 'row 1 value 1', second => 'row 1 value 2', }, { first => 'row 2 value 1', second => 'row 2 value 2', }, ], footer => { modified => 'Aug 31, 2006', }, } ;
Another way would be, after setting some values within $var,:
$vars = { %$vars, # Copy in the old values, then add to them.. header => { ...
"Battle not with trolls, lest ye become a troll; and if you gaze into the Internet, the Internet gazes also into you."
-Friedrich Nietzsche: A Dynamic Translation
In reply to Re: Template::Simple Help!
by NetWallah
in thread Template::Simple Help!
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |