>>>>> ""Chas" == "Chas Owens" <[EMAIL PROTECTED]> writes:

"Chas> On 10/15/07, Michael Barto <[EMAIL PROTECTED]> wrote:
>> As both Java and Javascript both have a 'true' and 'false' or Boolean data 
>> type, is
>> there any interest in evolution of Perl to have a true Boolean. Or what is 
>> the
>> preferred method to do this in Perl. The "C" programmers want me to use "0"'s
>> and "1"'s.
"Chas> snip

"Chas> Perl 5 does not have a boolean type.  Perl considers the following
"Chas> things as false: any number that is equivalent to 0 (0.0, 0e0, etc.),
"Chas> the string '0', the empty string, undef, or an empty list ( i.e. ()).

"The empty list" doesn't belong in that list.  Boolean forces scalar context,
and the scalar version of () is simply undef, which you've already listed.
Unless you also want to add (undef) or (0) or ("") to your list as well, which
are just as false, and for the same reason. :)

Yes, I know the third edition of the camel added this, but they were wrong.
Please don't propogate the mistake.  No edition of the camel that I was in
charge of got this wrong. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to