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

From: Lee <lee@afabco.org>
Date: Tue Aug 17 2010 - 17:18:13 AKDT

OK, Glad to know that 'testing' will always work.

I guess, after typing my response to Arthur, I came unhinged at the thought that true
and false weren't native keywords that could be used to pre-set variables that were
going to be used as booleans. Which admittedly is a much narrower issue than not doing
booleans.

Thanks!

---------- Original Message -----------
From: Michael Fowler <michael@shoebox.net>
To: Lee <lee@afabco.org>
Cc: aklug@aklug.org
Sent: Tue, 17 Aug 2010 16:32:09 -0800
Subject: Re: [aklug] perl doesn't natively do booleans?????

> On Tue, Aug 17, 2010 at 02:14:09PM -1000, Lee wrote:
> > 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?
>
> There are four false values: undef, 0, "0", ""
>
> Everything else is true.
>
> You do not compare to a value to determine true or false, you simply
> test:
>
> if ($foo) { ... }
>
> unless ($bar) { ... }
>
> while ($baz) { ... }
>
> if (10 == 20) { ... }
>
> Whether or not this means Perl has booleans depends on what you mean.
> Perl clearly has the ability to test for true or false.
>
> --
> Michael Fowler
> www.shoebox.net
------- End of Original Message -------

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

This archive was generated by hypermail 2.1.8 : Tue Aug 17 2010 - 17:18:20 AKDT