[aklug] perl doesn't natively do booleans?????

From: Lee <lee@afabco.org>
Date: Tue Aug 17 2010 - 16:14:09 AKDT

Which just blows my mind. So obviously I'm missing something because that just makes no
sense. What am I missing? How do you do conditionals? Or do you have to explicitly do
the comparison? (answer is 'not so far, apparently') But to what?

This stackoverflow just added to my confusion.

http://stackoverflow.com/questions/1036347/how-do-i-use-boolean-variables-in-perl

For example, the top answer implies numeric zero is always false. I've never -ever-
worked with -any- language (including english 8/ ) that could absolutely positively
unconditionally guarantee that. So rule number zero (no pun intended) is always and has
always been to -always- define the booleans -first-.

From the stackoverflow, some guy says do this:

use constant false => 0;
use constant true => 1;

But some other guy says that's a bad idea (which I can sort of see given perl's loose
typecasting)

Somebody else says:

use boolean;

but that generates an error, and Boolean.pm is 'not found', nor can I locate it in any
of the yum repos (something this basic should just be included. Actually, it should be
native, but since it's not that's why I'm sure I'm missing something).

So what fundamental principle am I missing here?

Thanks for listening.

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Tue, 17 Aug 2010 14:14:09 -1000

This archive was generated by hypermail 2.1.8 : Tue Aug 17 2010 - 16:14:16 AKDT