On Jun 27, Kevin Meltzer said:

>On Wed, Jun 27, 2001 at 11:51:01AM -0400, Chas Owens ([EMAIL PROTECTED]) spew-ed 
>forth:
>> On 27 Jun 2001 17:45:18 +0200, Jos Boumans wrote:
>> > > How do you mean?
>> > 
>> > concider:
>> > if ('a' == 'b') { print "foo" } # this will print 'foo', seeing 'a' and 'b' both 
>yield '1' in numeric
>> > context here.
>> 
>> You mean 0 not 1 don't you?
>
># perl -wle 'print "a" ? "Yes" : "no";'
>
>They are true values, 0 is false.

Values that can not be converted to a numerical value have the value of 0
in numerical context.  "a" is converted to 0 in numerical context, as are
"b", "foobar", "a1b2", and "-d3".

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734
**      Manning Publications, Co, is publishing my Perl Regex book      **

Reply via email to