Re: if statement
- From: Tad McClellan <tadmc@xxxxxxxxxxxxxx>
- Date: Thu, 27 Oct 2005 21:55:40 -0500
Chris H <socialism001@xxxxxxxxx> wrote:
> I'm finding the following code gets executed regardless of the value of
^^^^^^^^^^^^^
> distribution:
We may be unable to help you if you present untruths to us...
> $query->param('distribution') == "Yes";
That is a _numeric_ equality test.
You should always enable warnings when developing Perl code, it
would have found your mistake for you!
> How should I have the If statement when using $query variables.
> if $query->param('distribution') {
You should have the if statement (not If statement, case matters)
in actual Perl syntax, which requires parenthesis around the condition:
if ($query->param('distribution')) {
Please don't waste the time of hundreds (thousands?) of people
around the world with non-Perl code, nor with problems easily
found by a machine.
Have you seen the Posting Guidelines that are posted here frequently?
--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.
- Prev by Date: Re: How to merge two files like the following with the XML or text parser
- Next by Date: Re: to parse a string
- Previous by thread: Re: if statement
- Next by thread: Re: to parse a string
- Index(es):