in reply to Re^3: String comparison "\x00" vs. "".
in thread String comparison "\x00" vs. "".
An expression is false if it stringifies to any of the followingBut it wouldn't be Perl if there wasn't an exception to that:
prints just "world"use overload "bool" => sub {0}, '""' => sub {"Send in the clowns"}; my $o = bless []; # $o stringifies to "Send in the clowns" say "Hello" if $o; # No stringification happening here say "world" if "$o"; # Forced stringification
|
|---|