Hm. I'm not sure what you mean exactly. The module boolean will return the
number 1 for true and the number 0 for false. This will correctly work with
the if construct in Perl. You'll want to see perlsyn for the specifics about
Perl's true and false:
http://perldoc.perl.org/perlsyn.html#Truth-and-Falsehood The relevant
excerpt is:
The number 0, the strings '0' and '' , the empty list () , and undef are all
false in a boolean context. All other values are true. Negation of a true
value by ! or not returns a special false value. When evaluated as a string
it is treated as '' , but as a number, it is treated as 0.
Show quoted text-----Original Message-----
From: tech via RT
Sent: Saturday, December 11, 2010 15:20
To: DOUGDUDE@cpan.org
Subject: Re: [rt.cpan.org #63509] Perl's Boolean
<URL:
http://rt.cpan.org/Ticket/Display.html?id=63509 >
Hi,
I just updated the module using boolean.
somehow it makes it more complex because wring a
if( is_true($s){}
if( is_false($s){}
might be wrong, because if() does not use boolan of the module "boolean"
... correct?
Am 02.12.2010 01:10, schrieb Douglas Christopher Wilson via RT:
> Queue: String-Boolean
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=63509 >
>
> In the "boolean" module, it is actually using integers blessed into the
> "boolean" package. And yes, the author does bless just the number 1 and
> the number 0. I was just saying that since this module is directly
> handling out a Boolean from the boolean method, it'd be nice if it
> handed out the actual Perl core Boolean, in perlguts they discuss the
> PL_sv_no and PL_sv_yes Boolean values. So
>
> perl -e 'print 0'
> and
> perl -e 'print !!0'
>
> don't do the same thing. True is basically a 1 while false is an empty
> string. But really it doesn't matter. It was just a suggestion since the
> module was brand new :) Feel free to ignore it.
>
--
Andreas Hernitscheck
E-mail: tech@tool.de
Gertrud-Bäumer-Str. 10
80637 Munich, Germany
Phone: +49 176 210 16 397
Fax: +49 89 21997682
Konferenz: +49 89 21997662
(PIN: 8000)