DOH!
Something Silly(tm)
Thanks ;)
----- Original Message ----- From: "Chris Devers" <[EMAIL PROTECTED]>
To: "Chris Knipe" <[EMAIL PROTECTED]>
Cc: "Perl Beginners List" <beginners@perl.org>
Sent: Tuesday, March 29, 2005 9:07 PM
Subject: Re: CGI.pm
On Tue, 29 Mar 2005, Chris Knipe wrote:
if (!$Query->request_method() eq "POST") { exit; }
Using a GET / HEAD method, the IF statement never executes.
Nor would it -- the exclamation point isn't in the right place.
This statement is saying "if not-$query->request_method() equals POST", but "not-$query..." makes no sense.
But an exclamation point is the wrong approach here. If you want to say that $foo should not equal $bar, use the "not equal" condition -- 'ne':
if $Query->request_method() ne "POST" { exit; }
That should do what you want.
-- Chris Devers
-- 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>