Just another Perl shrine | |
PerlMonks |
Re: Converting to booleanby Sidhekin (Priest) |
on Jun 17, 2004 at 03:50 UTC ( [id://367522]=note: print w/replies, xml ) | Need Help?? |
I use !!$x for this. Perl6 will give us ?$x, which ought to be clearer. If I wanted to store the boolean back into the same variable, I might prefer a mutator: $x &&= 1. However, there is a real difference:
... something to be aware of :-)
print "Just another Perl ${\(trickster and hacker)},"
In Section
Meditations
|
|