Ok, sorry.

This now, does not make sense AT ALL!!!!

useing == (which is wrong), matches.
useing eq (which is right?) never matches...

Surely, if I match $ENV{REQUEST_METHOD} I am matching a string value.... Why, oh why dear mighty will == match (and give me a warning), and eq never matches....

--
Chris.

I love deadlines. I especially love the whooshing sound they make as they fly by..." - Douglas Adams, 'Hitchhiker's Guide to the Galaxy'

----- Original Message ----- From: "Chris Knipe" <[EMAIL PROTECTED]>
To: <beginners@perl.org>
Sent: Tuesday, March 29, 2005 9:00 PM
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.



--
Chris.

I love deadlines. I especially love the whooshing sound they make as they fly by..." - Douglas Adams, 'Hitchhiker's Guide to the Galaxy'

----- Original Message ----- From: "Chris Heiland" <[EMAIL PROTECTED]>
To: <beginners@perl.org>
Sent: Tuesday, March 29, 2005 8:52 PM
Subject: RE: CGI.pm





-----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;
}

Using a GET / HEAD method, the IF statement never executes.
I am trying to verify the user agent, but the above is just
for my test - which is failing.

Anyone got some clues?

--
Chris.

I love deadlines. I especially love the whooshing sound they
make as they fly by..." - Douglas Adams, 'Hitchhiker's Guide
to the Galaxy'


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


Untested:

if ($query->request_method() =~ m/^post$/i) {
do something;
}

Chris

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





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




--
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