in reply to Template::Simple Help!
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Template::Simple Help!
by Anonymous Monk on Dec 23, 2011 at 18:37 UTC | |
by NetWallah (Canon) on Dec 23, 2011 at 20:36 UTC | |
by Anonymous Monk on Dec 23, 2011 at 20:58 UTC | |
by NetWallah (Canon) on Dec 23, 2011 at 22:52 UTC | |
by Anonymous Monk on Dec 24, 2011 at 03:53 UTC | |
|