this worked great except as noted below..
use CGI qw/-nph :all :ReadParse/;
use CGI::Carp 'fatalsToBrowser';
&ReadParse;
foreach $key (keys %in) {
print "$key --> $in{$key}\n";
}
if (&ReadParse(\*FORM)) {
## ^ note the &
#Yes, there is something.
foreach $key (keys %FORM) {
print "$key --> $FORM{$key}\n";
}
}
else {
#No, nothing, so show a default form
#and exit...
}
> > > I've got a script which has to read in a variable number of
> > > parameters.
> > > Up 'till now, I've been using the CGI param() function to read in each
> > > variable one at a time. This won't work if I don't know how many
> > > variables there might be though, or what they'll be called.
> >
> > @parameters = param();
> >
> How about...
>
> use CGI qw/-nph :all :ReadParse/;
> use CGI::Carp 'fatalsToBrowser';
>
> &ReadParse;
>
> foreach $key (keys %in) {
> print "$key --> $in{$key}\n";
> }
>
> Works for me in a big way. Never had a problem. Used to use it
> with cgi-lib.pl
>
> Also, the following works nicely to see if there are any parameters in the
> first place.
>
> if ($ReadParse(\*FORM)) {
> #Yes, there is something.
> foreach $key (keys %FORM) {
> print "$key --> $FORM{$key}\n";
> }
> }
> else {
> #No, nothing, so show a default form
> #and exit...
> }
>
> Conrad
>
> ----- Original Message -----
> From: "Thomas_M" <[EMAIL PROTECTED]>
> To: "Perl-Win32-Users Mailing List"
> <[EMAIL PROTECTED]>
> Cc: "Perl-Win32-Users" <[EMAIL PROTECTED]>
> Sent: Tuesday, May 23, 2000 2:25 PM
> Subject: RE: reading in parameters using the CGI module
>
>
> > Kathryn Cassidy [mailto:[EMAIL PROTECTED]] wrote:
> > >
> > > I've got a script which has to read in a variable number of
> > > parameters.
> > > Up 'till now, I've been using the CGI param() function to read in each
> > > variable one at a time. This won't work if I don't know how many
> > > variables there might be though, or what they'll be called.
> >
> > @parameters = param();
> >
> > Now you know how many there are (scalar(@parameters)) and what they
> > are named.
> >
> > --
> > Mark Thomas
> > [EMAIL PROTECTED]
> >
>
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]