On Sun, 2007-01-14 at 19:01 +0000, Ash Berlin wrote: > Igor Longagnani wrote: > > Hi, newbie here... > > i thought i had understood stash behaviour... but prolly not :) > > > > I can use it together with DBIx::Class resultsets and so on, BUT now i > > would like to put such an hashref > > > > $chiavi= { > > 'ka-111-234-586' => '0', > > 'ka-90-85-349' => '0', > > 'ka-5-21-629' => '0', > > 'ka-1-406-194' => '0', > > 'ka-111-194-479' => '1', > > 'ka-1-451-540' => '0', > > 'ka-1-254-610' => '0', > > 'ka-1-216-571' => '0', > > ... more data... > > }; > > > > into the stash e.g. $c->stash->{allegati} = $chiavi; > > then i would like to use something like > > > > <! -- standard cycle through some kind of data --> > > [ FOREACH ... %] > > ... > > <!-- build one of the key of the hashref 'allegati' --> > > [% currentkey = ...%] > > > > <!-- use one of the values of the hashref --> > > [% allegati.currentkey %] > > > > > > The problem is this last [% allegati.currentkey %] is always empty even > > if i am sure i am asking for an existing key of the hash ref. > > What am i doing wrong? > > I know it is something silly ... but still makes me doubt about my > > comprehension of the stash > > > > Any wise suggestion? > > Yes - show us the code for the action and the full template - the info > you've given isn't enough do divine the problem.
Though I do not understand what you are trying to do either, you may try: [% FOREACH entry=allegati %] [% entry.key %]: [% entry.value %] [% END %] Hope it helps, Sébastien > > Ash > > _______________________________________________ > List: Catalyst@lists.rawmode.org > Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst > Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ > Dev site: http://dev.catalyst.perl.org/ _______________________________________________ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/