On Wed, Apr 15, 2009 at 07:33, John W. Krahn <jwkr...@shaw.ca> wrote:
> Robert Citek wrote:
>>
>> On Wed, Apr 15, 2009 at 12:08 AM, Brian <brian5432...@yahoo.co.uk> wrote:
>>>
>>> could someone please help me with this little problem?
>>> I am trying to include an if statement part way through printing.
>>> When the program reaches the line   if ($Lang = fr ) { print "
>>> that line gets ignored and the cgi keeps going to the end.
>>
>> You probably want ($Lang == "fr")
>
> Probably not.  You are using a numerical comparison on a string which will
> convert the string to a number so that is the same as saying: ($Lang == 0)
snip

Using the eq operator, a regex, or (if you have Perl 5.10)
the ~~ operator is a much better choice.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to