tt hash values not printing....
Rajeev Prasad <rp.neuli-/[email protected]> Tue, 30 Oct 2012 13:07:06 -0700 (PDT)
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <[email protected]> |
starting with a hash ref....
my $my_hash = {};
building the hash in a loop...
push(@tmp_arr,$val1);
push(@tmp_arr,$val2);
$my_hash->{$index} = \@tmp_arr;
the elements for any key can be access fine as $my_hash->{$index}[0]
I am passing a hash like this:
my $vars = {
myhash => $my_hash
};
PROBLEM 1: trying to print like this, it prints the index correctly but does not print any values.... i am confused why?
[%- FOREACH index IN myhash.keys.sort -%]
<tt>index number=[%index%] dt-time=[%myhash.$index.0%] detail=[%myhash.$index.1%]<tt>
[% END -%]
PROBLEM 2: the sort is not sorting numerically, so i get 1,10,11,12.... 2,20,21.....