Dermot wrote:
Hi,
I saw this notation today:
!! $class->method;
or as an assignment:
my $var = !! $class->method;
I can't find a definition for it in perlsyn or perlop. I don't think
it's restricted to classes. I suspect this is boolean but I'd like to
know.
Any pointers?
Thanx,
Dp.
my $var = ! ( ! ( $foo ) );
It is a double negation; see `perldoc perlop` and search for /Symbolic
Unary Operators/
It has two effects:
1. It converts an undef (and other false thingys) into an empty string.
2. It converts non-false thingys into 1.
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where you can bless your
thingy.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/