[dancer-users] How tod displaye aMulti Dimesional Hash in Template Toolkit

Gabor Szabo gabor at szabgab.com
Mon Aug 24 00:10:58 EDT 2020


Try putting that backslash back so it will be

   template 'results.tt' => {

        'title' => 'Get Softball Season Stats',
        'payload' => \%season,

    }, {};
Gabor

On Sun, Aug 23, 2020 at 10:44 PM Richard Reina <gatorreina at gmail.com> wrote:

> I was merely passing it as with different var name to distinguish from
> different attempts in my html. Taking out the other case, as I have
> done, has no effect on the results.
>
> This is what is being passed the html in the paste above:
>
>    template 'results.tt' => {
>
>         'title' => 'Get Softball Season Stats',
>         'payload' => %season,
>
>     }, {};
>
> And this is the result:
>
>
> Trying with payload
> TylerMontgomery(2022) ------------- TylerMontgomery(2022) :
> TylerMontgomery(2022)
>
> Name atbats so bb rbis hits runs TylerMontgomery(2022)
>
>
> 2020-08-23 14:22 GMT-05:00, Gabor Szabo <gabor at szabgab.com>:
> > OK, so I don't understand why do you pass the same %payload 3 times, but
> > you need to pass references in all 3 cases.
> >
> > template 'results.tt' => {
> > 'title' => 'Get Softball Season Stats',
> > 'games' => \%season,
> > 'season' => \%season,
> > 'payload' => \%season,
> > 'F_NAME' => 'Geraldo',
> >
> >
> >     }, {};
> >
> > On Sun, Aug 23, 2020 at 9:38 PM Richard Reina <gatorreina at gmail.com>
> wrote:
> >
> >>  template 'results.tt' => {
> >>
> >>         'title' => 'Get Softball Season Stats',
> >>         'payload' => \%season,
> >>
> >>     }, {};
> >>
> >> Results in this:
> >>
> >> Trying with payload
> >> ------------- :
> >>
> >> Name atbats so bb rbis hits runs
> >>
> >>
> >>
> >> 2020-08-23 12:53 GMT-05:00, Gabor Szabo <gabor at szabgab.com>:
> >> > I think you should be passing references:
> >> >
> >> > 'payload' => \%season,
> >> >
> >> > See the backslash.
> >> >
> >> > Gabor
> >> >
> >> >
> >> >
> >> > On Sun, Aug 23, 2020 at 8:45 PM Richard Reina <gatorreina at gmail.com>
> >> wrote:
> >> >
> >> >> Ok, maybe I've overlooked something but here is what I get with very
> >> >> simple call to a route and using very simple html.
> >> >>
> >> >> http://paste.scsys.co.uk/592477
> >> >>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20200824/f8de314b/attachment-0001.htm>


More information about the dancer-users mailing list