perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Smith" <smi...@gmail.com>
Subject Re: Embperl2 and Execute
Date Fri, 18 Aug 2006 09:57:58 GMT
Hi Marek,

I'd suggest something a bit more like this (it's untested but hopefully you
get the idea):

[- @tmp=(1..3) -]
[$ foreach $r (@tmp) $]
<input type='text' name='test_[+ $r +]' / value="[+ $r +]">
[$ endforeach $]

Hope this helps - obviosuly TMTOWTDI, but I try to avoid putting HTML in the
perl sections.

Michael


On 8/18/06, Marek Matis <marek.matis@gmail.com> wrote:
>
> Hi,
> I have problem with Execute (EmbPerl2.0r3).
>
> [-
> @tmp = (1 .. 3);
>
> foreach $r (@tmp) {
>
> $fdat{'test_'.$r} = $r;
> $out = "<input type='text' name='test_$r' />\n";
> Execute ({ input => \$out });
> }
> -]
>
>
> Output is:
>
> <input type='text' name='test_1' / value="1">
> <input type='text' name='test_1' / value="1">
> <input type='text' name='test_1' / value="1">
>
>
> I need this:
>
> <input type='text' name='test_1' / value="1">
> <input type='text' name='test_2' / value="2">
> <input type='text' name='test_3' / value="3">
>
>
>
> Thanks
> Marek
>
>
>
>

Mime
View raw message