--- Luke Palmer <[EMAIL PROTECTED]> wrote:
> Paul Hodges writes:
> > So, in P6:
> >
> > if 0 { print "0\n"; } # I assume this won't print.
> > if '0' { print "'0'\n"; } # I assume this won't print.
> > if '' { print "''\n"; } # I assume this won't print.
> > if undef { print "undef\n"; } # I assume this won't print.
> >
> > But my question is, will this:
> >
> > if "\0" { print null\n"; } # Is this going to print, or not?
>
> As far as things are currently defined, yes, it will print. And your
> syntax is perfect... well, maybe not:
>
> if undef { print "undef\n"; }
>
> Might be interpreted as:
>
> if undef( { print "undef\n"; } ) # syntax error, expecting {
>
> But close enough anyway.
Maybe I should have been more specific:
if undef() { whatever(); }
But it's a moot point, since only a moron would test what he knowks the
answer to -- unless it's one of those wierd cases, and then he could
just use 0 instead......
So, putting it back into the context of real things.....
> If you must check for a null byte, it's as simple as:
>
> unless $chr { print "0, '', or '0' }
> unless ord $chr { print "null byte" }
So a null byte is still Boolean true.
Ugh, yarf, ack, etc.
But as long as I know -- easy enough to check explicitly.
But just tell me this....am I the only guy who thinks this *feels*
wierd? Understanding the reason doesn't make it any more ~comfortable~.
Paul
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo