Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks!!
I am trying to pass a dynamic value to print a value out of an array using Mojo::Template, getting syntax errors, is there a way to do that?
The code works if its like this:
I'd like to pass the index number dynamic using the example below:<% $local->{ place }[ 0 ]{ street } %>
Code snipped from the .ep template file:
<%= $number %>, can be 0,1,2,3...<p> Location: <br/> <% $local->{ place }[ %> <%= $number %> <% ]{ street } %> </p>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Mojo Template, passing dynamic index to array.
by jdporter (Paladin) on Jul 13, 2021 at 19:02 UTC | |
Re: Mojo Template, passing dynamic index to array.
by LanX (Saint) on Jul 13, 2021 at 19:16 UTC | |
Re: Mojo Template, passing dynamic index to array.
by Anonymous Monk on Jul 14, 2021 at 07:08 UTC | |
by marto (Cardinal) on Jul 14, 2021 at 10:37 UTC | |
by LanX (Saint) on Jul 16, 2021 at 16:32 UTC | |
by marto (Cardinal) on Jul 16, 2021 at 16:56 UTC | |
by LanX (Saint) on Jul 16, 2021 at 16:59 UTC | |
| |
by Anonymous Monk on Jul 16, 2021 at 14:39 UTC | |
by marto (Cardinal) on Jul 16, 2021 at 16:55 UTC |
Back to
Seekers of Perl Wisdom