develooper Front page | perl.perl5.porters | Postings from June 2003

Re: perlbool.pod

Thread Previous | Thread Next
From:
Tassilo von Parseval
Date:
June 30, 2003 01:18
Subject:
Re: perlbool.pod
Message ID:
20030630073312.GA1352@ethan
[ disclaimer: not sure whether this has already been commented on as my
  university had a mail outage for half a day and I suspect some mail
  loss - had just one new spam mail this morning ]
  
On Sun, Jun 29, 2003 at 09:12:53PM +0900 Dan Kogai wrote:

> Here is a draft of perlbool.pod.  Since we already have perlnumber.pod 
> and overload.pm can handle bool differently from "" and 0+, I think 
> boolean deserves a distinct pod if not a section.

Yes, can't hurt.

> =head1 NAME
> 
> perlbool - semantics of boolean operations and conversions in Perl
> 
> =head1 SYNOPSIS

[...]

>   ()           # scalar () is 0 so false
>   (0)          # scalar (0) is 1 so true!

Better drop that...or rephrase it. As it currently stands, it's not
correct because (0) is a list which, in "scalar context", evalutes to 0
and thus is false. I put that into quotes because technically speaking
there is not even a scalar context for lists. You have to use an array
for that:

    @a = (0)     # scalar @a is 1 so true!

[...]

> =head2 References
> 
> Unlike C which has null pointers, perl's reference is always true
> because in string context it would be something like
> C<SCALAR(0x8134654)> in string and C<135480916>.

"...in numerical context because C<0x8134654> is hexadecimal for
C<135480916>". As it is the sentence looks incomplete.

[...]

Other than that, I like this draft. It's terse and straight to the point
which is what a user is most likely to find helpful.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About