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

Re: perlbool.pod

Thread Previous | Thread Next
Tassilo von Parseval
June 30, 2003 01:18
Re: perlbool.pod
Message ID:
[ 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 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>.

" 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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About