<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">You need to add<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">template: template_toolkit</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">engines:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> template:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> template_toolkit:</span></div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""> start_tag: '<%'</div><div style="margin: 0px; font-stretch: normal; font-size: 10px; line-height: normal; font-family: Monaco;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> stop_tag: '%>'</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">into environments/development.yaml</div><div class=""><br class=""></div><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">— <br class="">Clive Eisen<br class="">GPG: 3818B5F1<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""></div></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 24 Aug 2020, at 16:26, Richard Reina <<a href="mailto:gatorreina@gmail.com" class="">gatorreina@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I am going out of my mind. I have no idea what could be wrong.<div class=""><br class=""></div><div class="">Below is my route (with the hash defined in it), my html and the results I get in the browser.</div><div class=""><br class=""></div><div class="">get '/results' => sub {<br class=""> <br class=""> # Test the hash<br class=""> my %season= (<br class=""> 'TylerMontgomery(2022)' => {<br class=""> 'so' => 1,<br class=""> 'bb' => 1,<br class=""> 'rbis' => 0,<br class=""> 'atbats' => 117,<br class=""> 'runs' => 2,<br class=""> 'hits' => 2<br class=""> },<br class=""> 'ChaseLangan(2022)' => {<br class=""> 'runs' => 4,<br class=""> 'hits' => 24,<br class=""> 'atbats' => 5,<br class=""> 'bb' => 0,<br class=""> 'rbis' => 2,<br class=""> 'so' => 1<br class=""> },<br class=""> 'BryceJones(2021)' => {<br class=""> 'hits' => 2,<br class=""> 'runs' => 2,<br class=""> 'atbats' => 4,<br class=""> 'bb' => 2,<br class=""> 'rbis' => 4,<br class=""> 'so' => 1<br class=""> },<br class=""> );<br class=""><br class=""> <br class=""> template '<a href="http://results.tt/" class="">results.tt</a>' => {<br class=""> <br class=""> 'title' => 'Get Softball Season Stats',<br class=""> 'payload' => \%season,<br class=""> <br class=""> }, {};<br class=""><br class="">};<br class=""></div><div class=""><br class=""></div><div class="">################################################</div><div class="">HTML</div><div class="">################################################</div><div class=""><!DOCTYPE html><br class=""><html lang="en"><br class=""> <head><br class=""> <!-- head definitions go here --><br class=""> <meta charset="utf-8"> <br class=""> </head><br class=""> <body><br class=""> <br class=""> <% IF payload.size %> <!-- season data --------------------------------------><br class=""> <% payload.size %><br class=""> <% USE Dumper; Dumper.dump(payload) %><br class=""> <br class=""> <div class="container" style="margin-top:20px;"><br class=""> <h3>Trying with Gabor's solution</h3> <br class=""> <% FOR name IN payload.keys.sort %><br class=""> <% name %><br class=""> -------------<br class=""> <%- FOR field IN payload.$name.keys.sort %><br class=""> <p>Field: </p><% field %> : <% payload.$name.$field -%><br class=""> <p>Field: </p><% field %> : <% payload.$name.atbats -%><br class=""> <% END %><br class=""> <% END %><br class=""> </div><br class=""> <br class=""> <div class="container" style="margin-top:20px;"><br class=""> <h3>Trying with Ikegami's solution</h3> <br class=""> <% FOREACH id IN payload.keys %><br class=""> <% season = payload.$id %><br class=""> <p><% season.runs %></p><br class=""> <p><% season.atbats %></p><br class=""> <% END %><br class=""> </div><br class=""> <br class=""> <br> <br><br class=""> <div class="container" style="margin-top:20px;"><br class=""> <% USE String %><br class=""> <br class=""> Name atbats so bb rbis hits runs<br class=""> <% FOR name IN payload.keys.sort %><br class=""> <% fname = String.new(name) -%><br class=""> <% atbats = String.new(payload.$name.atbats) -%><br class=""> <% so = String.new(payload.$name.so) -%><br class=""> <% bb = String.new(payload.$<a href="http://name.bb/" class="">name.bb</a> ) -%><br class=""> <% rbis = String.new(payload.$name.rbis) -%><br class=""> <% hits = String.new(payload.$name.hits) -%><br class=""> <% runs = String.new(payload.$name.runs) -%><br class=""> <% fname.left(22) %> <% atbats.right(3) -%> <% so.right(3) -%> <% bb.right(3) -%> <% rbis.right(3) -%> <% hits.right(3) -%> <% runs.right(3) -%><br class=""> <% END %><br class=""> <% END %><br class=""> </div><br class=""> <br class=""> <div class="container" style="margin-top:20px;"><br class=""> <h3>Trying with Perlmonks solution</h3> <br class=""> <% FOREACH brevet = payload %><br class=""> brevet.key <% brevet.key %><br class=""> brevet.val <% brevet.value %><br class=""> brevet.$val.hits <% brevet.$value.atbats %><br class=""> brevet.val.atbats <% brevet.value.runs %><br class=""> brevet.val.dist <% brevet.value.hits %><br class=""> <% END %><br class=""> </div><br class=""> </body><br class=""></html><br class=""><br class=""></div><div class="">#######################################################</div><div class="">The results that appear in the browser</div><div class="">#######################################################</div><div class=""><div class="gmail-container" style="color:rgb(51,51,51);font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;margin-top:20px"><h3 style="font-family:sans-serif;margin:1.2em 0px 0.6em" class="">Trying with Gabor's solution</h3>-------------<p style="line-height:1.5em;margin:1.6em 0px" class="">Field:</p>:<p style="line-height:1.5em;margin:1.6em 0px" class="">Field:</p>:</div><div class="gmail-container" style="color:rgb(51,51,51);font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;margin-top:20px"><h3 style="font-family:sans-serif;margin:1.2em 0px 0.6em" class="">Trying with Ikegami's solution</h3><div style="line-height: 1.5em; margin: 1.6em 0px;" class=""><br class="webkit-block-placeholder"></div><div style="line-height: 1.5em; margin: 1.6em 0px;" class=""><br class="webkit-block-placeholder"></div></div><br style="color:rgb(51,51,51);font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px" class=""><br style="color:rgb(51,51,51);font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px" class=""><div class="gmail-container" style="color:rgb(51,51,51);font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;margin-top:20px">Name atbats so bb rbis hits runs</div><div class="gmail-container" style="color:rgb(51,51,51);font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;margin-top:20px"><h3 style="font-family:sans-serif;margin:1.2em 0px 0.6em" class="">Trying with Perlmonks solution</h3>HASH(0x17982b0) brevet.key brevet.val brevet.$val.hits brevet.val.atbats brevet.val.dist</div><div id="gmail-footer" style="clear:both;padding-top:2em;text-align:center;padding-right:160px;font-family:sans-serif;font-size:10px;color:rgb(51,51,51)" class="">Powered by <a href="http://perldancer.org/" style="color:rgb(0,51,204)" class="">Dancer2</a> 0.300004</div></div><div id="gmail-footer" style="text-align:left;clear:both;padding-top:2em;padding-right:160px;font-family:sans-serif;font-size:10px;color:rgb(51,51,51)" class="">##############################################################################################</div><div id="gmail-footer" style="text-align:left;clear:both;padding-top:2em;padding-right:160px;font-family:sans-serif;color:rgb(51,51,51)" class=""><i class="">If I replace 'payload' => \%season, with 'payload' => %season and restart my app with plackup bin/app.psgi then the results in the browser are:</i></div><div id="gmail-footer" style="text-align:left;clear:both;padding-top:2em;padding-right:160px;font-family:sans-serif;font-size:10px;color:rgb(51,51,51)" class=""><span style="font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;background-color:rgb(221,221,221)" class="">TylerMontgomery(2022) </span><span style="font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;background-color:rgb(221,221,221)" class="">TylerMontgomery(2022)</span><div class="gmail-container" style="font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;margin-top:20px"><h3 style="font-family:sans-serif;margin:1.2em 0px 0.6em" class="">Trying with Gabor's solution</h3>TylerMontgomery(2022) ------------- TylerMontgomery(2022)<p style="line-height:1.5em;margin:1.6em 0px" class="">Field:</p>: TylerMontgomery(2022)<p style="line-height:1.5em;margin:1.6em 0px" class="">Field:</p>: TylerMontgomery(2022)</div><div class="gmail-container" style="font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;margin-top:20px"><h3 style="font-family:sans-serif;margin:1.2em 0px 0.6em" class="">Trying with Ikegami's solution</h3>TylerMontgomery(2022) TylerMontgomery(2022)<div style="line-height: 1.5em; margin: 1.6em 0px;" class=""><br class="webkit-block-placeholder"></div><div style="line-height: 1.5em; margin: 1.6em 0px;" class=""><br class="webkit-block-placeholder"></div></div><br style="font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px" class=""><br style="font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px" class=""><div class="gmail-container" style="font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;margin-top:20px">Name atbats so bb rbis hits runs TylerMontgomery(2022)</div><div class="gmail-container" style="font-family:"Lucida Grande","Bitstream Vera Sans",Verdana;font-size:13px;margin-top:20px"><h3 style="font-family:sans-serif;margin:1.2em 0px 0.6em" class="">Trying with Perlmonks solution</h3>TylerMontgomery(2022) brevet.key brevet.val brevet.$val.hits brevet.val.atbats brevet.val.dist</div><div id="gmail-footer" style="clear:both;padding-top:2em;text-align:center;padding-right:160px" class="">Powered by <a href="http://perldancer.org/" style="color:rgb(0,51,204)" class="">Dancer2</a> 0.300004</div></div><div id="gmail-footer" style="clear:both;padding-top:2em;text-align:center;padding-right:160px;font-family:sans-serif;font-size:10px;color:rgb(51,51,51)" class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El dom., 23 ago. 2020 a las 23:11, Gabor Szabo (<<a href="mailto:gabor@szabgab.com" class="">gabor@szabgab.com</a>>) escribió:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class="">Try putting that backslash back so it will be<br class=""></div><div class=""><br class=""></div><div class=""> template '<a href="http://results.tt/" rel="noreferrer" target="_blank" class="">results.tt</a>' => {<br class="">
<br class="">
'title' => 'Get Softball Season Stats',<br class="">
'payload' => \%season,<br class="">
<br class="">
}, {};<br class="">
</div>Gabor<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 23, 2020 at 10:44 PM Richard Reina <<a href="mailto:gatorreina@gmail.com" target="_blank" class="">gatorreina@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I was merely passing it as with different var name to distinguish from<br class="">
different attempts in my html. Taking out the other case, as I have<br class="">
done, has no effect on the results.<br class="">
<br class="">
This is what is being passed the html in the paste above:<br class="">
<br class="">
template '<a href="http://results.tt/" rel="noreferrer" target="_blank" class="">results.tt</a>' => {<br class="">
<br class="">
'title' => 'Get Softball Season Stats',<br class="">
'payload' => %season,<br class="">
<br class="">
}, {};<br class="">
<br class="">
And this is the result:<br class="">
<br class="">
<br class="">
Trying with payload<br class="">
TylerMontgomery(2022) ------------- TylerMontgomery(2022) :<br class="">
TylerMontgomery(2022)<br class="">
<br class="">
Name atbats so bb rbis hits runs TylerMontgomery(2022)<br class="">
<br class="">
<br class="">
2020-08-23 14:22 GMT-05:00, Gabor Szabo <<a href="mailto:gabor@szabgab.com" target="_blank" class="">gabor@szabgab.com</a>>:<br class="">
> OK, so I don't understand why do you pass the same %payload 3 times, but<br class="">
> you need to pass references in all 3 cases.<br class="">
><br class="">
> template '<a href="http://results.tt/" rel="noreferrer" target="_blank" class="">results.tt</a>' => {<br class="">
> 'title' => 'Get Softball Season Stats',<br class="">
> 'games' => \%season,<br class="">
> 'season' => \%season,<br class="">
> 'payload' => \%season,<br class="">
> 'F_NAME' => 'Geraldo',<br class="">
><br class="">
><br class="">
> }, {};<br class="">
><br class="">
> On Sun, Aug 23, 2020 at 9:38 PM Richard Reina <<a href="mailto:gatorreina@gmail.com" target="_blank" class="">gatorreina@gmail.com</a>> wrote:<br class="">
><br class="">
>> template '<a href="http://results.tt/" rel="noreferrer" target="_blank" class="">results.tt</a>' => {<br class="">
>><br class="">
>> 'title' => 'Get Softball Season Stats',<br class="">
>> 'payload' => \%season,<br class="">
>><br class="">
>> }, {};<br class="">
>><br class="">
>> Results in this:<br class="">
>><br class="">
>> Trying with payload<br class="">
>> ------------- :<br class="">
>><br class="">
>> Name atbats so bb rbis hits runs<br class="">
>><br class="">
>><br class="">
>><br class="">
>> 2020-08-23 12:53 GMT-05:00, Gabor Szabo <<a href="mailto:gabor@szabgab.com" target="_blank" class="">gabor@szabgab.com</a>>:<br class="">
>> > I think you should be passing references:<br class="">
>> ><br class="">
>> > 'payload' => \%season,<br class="">
>> ><br class="">
>> > See the backslash.<br class="">
>> ><br class="">
>> > Gabor<br class="">
>> ><br class="">
>> ><br class="">
>> ><br class="">
>> > On Sun, Aug 23, 2020 at 8:45 PM Richard Reina <<a href="mailto:gatorreina@gmail.com" target="_blank" class="">gatorreina@gmail.com</a>><br class="">
>> wrote:<br class="">
>> ><br class="">
>> >> Ok, maybe I've overlooked something but here is what I get with very<br class="">
>> >> simple call to a route and using very simple html.<br class="">
>> >><br class="">
>> >> <a href="http://paste.scsys.co.uk/592477" rel="noreferrer" target="_blank" class="">http://paste.scsys.co.uk/592477</a><br class="">
>> >><br class=""><br class="">
</blockquote></div></div>
</blockquote></div>
_______________________________________________<br class="">dancer-users mailing list<br class=""><a href="mailto:dancer-users@lists.preshweb.co.uk" class="">dancer-users@lists.preshweb.co.uk</a><br class="">https://lists.preshweb.co.uk/mailman/listinfo/dancer-users<br class=""></div></blockquote></div><br class=""></div></body></html>