On 04/08/2008 07:10 PM, suppressed wrote:
> I should be able to do
>
> [tmp][perl]
> while (($key, $value) = each %CGI::values) { }
>
> ## or
>
> foreach my $key ( keys %CGI::values ) {}
> [/perl][/tmp]
>
> because I see code like that in the core, but it doesn't work. Can
> someone tell me how to loop through the form variables?
The code that you can use in [perl] and [calc] blocks is different from
what is used in the core. This is because [perl] blocks are subject to
safe hole restrictions. In your code above you would use %$CGI instead
of %CGI::values:
while (my ($key, $value) = each %$CGI) {
...
}
For a list of perl variables you can use in [perl] and [calc] blocks and
their equivalents in the core see:
http://www.interchange.rtfm.info/icdocs/Interchange_Perl_objects.html
Peter
_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.