On Sat, Oct 07, 2000 at 06:59:51PM -0400, Ilia Lobsanov wrote:
> Anyone notice a crash with this little test script:
> 
> [-
> @bar = ('a', 'blah', 'c');
> -]
> [$ foreach $foo @bar $]
>   [- next if $foo eq 'blah' -]
>   [+ $foo +]<BR>
> [$ endforeach $]
> 
> ilia.
> 

I can confirm it crashes. It cannot work because the meta command
"foreach" is not the same as the perl command "foreach", so you
cannot use "next" with it. Nevertheless I agree with you that
Apache should not segfault because of this...

However, you may use the following:
[-
@bar = ('a', 'blah', 'c');
foreach $foo (@bar) {   
  next if $foo eq 'blah'; 
  print "$foo<BR>";
} 
-]

Andre

--
 /"\
 \ /
  X  ASCII Ribbon campaign against HTML E-Mail
 / \

PGP signature

Reply via email to