in reply to Re: Breaking The Rules
in thread Breaking The Rules
This happens because the "eq" operator stringifies both of its arguments, and undef stringifies to the empty string. The warning doesn't exist just to critique your syntax... it's warning you of a danger that your code might not be doing exactly what you think it is.my $var = undef; print "Undefined!\n" if $var eq undef; $var = ''; print "Undefined again!\n" if $var eq undef;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Breaking The Rules
by Unanimous Monk (Sexton) on May 31, 2006 at 22:15 UTC |