> -----Original Message-----
> From: Chris Knipe [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, March 29, 2005 11:01 AM
> To: beginners@perl.org
> Subject: Re: CGI.pm
> 
> Strange indeed.
> 
> For further debuging, I did:
> 
> print $ENV{REQUEST_METHOD};
> 
> This, as expected, returns POST.
> 
> print $Query->request-method();
> 
> NULL value.
> 
> if ($ENV{REQUEST_METHOD} eq "POST")
> 
> Does not match....
> 
> Another one of those ARGH moments, or am I doing something silly?
> 
> --
> Chris.
> 
[snip]
> >
> >> -----Original Message-----
> >> From: Chris Knipe [mailto:[EMAIL PROTECTED]
> >> Sent: Tuesday, March 29, 2005 10:45 AM
> >> To: beginners@perl.org
> >> Subject: CGI.pm
> >>
> >> Lo all,
> >>
> >> Very quickly....
> >>
> >> #!/usr/bin/perl
> >> use CGI;
> >> use strict;
> >> use warnings;
> >>
> >> my $Query = new CGI;
> >> if (!$Query->request_method() eq "POST") {
> >>   exit;
> >> }
[snip]
> >
> > Untested:
> >
> > if ($query->request_method() =~ m/^post$/i) {
> > do something;
> > }
> >
> > Chris

If you are just testing to see if they submitted the form then:

if ($ENV{'REQUEST_METHOD'} =~ m/^post$/i)       {
        do something;
}

If you are trying to see what is in the variables then I suggest
Data::Dumper:
perldoc Data::Dumper

Then just do a dump of what you think should contain something and it will
show you the contents.  But then again it ultimately matters by what you
want to do with 'verify the user agent'.

Chris

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to