I tried both with brackets and without, the same result :(
If i try this...
[$ foreach $row @$result $]
[+ $row +]
[$ endforech $]
... the only output is a '0', there should be an ARRAY ref there.
btw, I'm using on embperl 1.3.4
/Christian
----- Original Message -----
From: "Gavin Carr" <[EMAIL PROTECTED]>
To: "Christian Frantsen" <[EMAIL PROTECTED]>
Sent: Sunday, February 24, 2002 9:33 PM
Subject: Re: Problem with foreach
> On Sun, Feb 24, 2002 at 07:14:23PM +0100, Christian Frantsen wrote:
> > Could someone explain to me why this works...
> >
> > [-
> > foreach $row (@$result) {
> > print OUT "$row->[1]";
> > }
> > -]
> >
> > .. and this doesn't?
> >
> > [$ foreach $row @$result $]
> > [+ $row->[1] +]
> > [$ endsub $]
>
> You're missing brackets round the @$result aren't you?
>
> [$ foreach $row (@$result) $]
>
> Otherwise the second one should work fine.
>
> Cheers,
> Gavin
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]