I don't see how the eq case is any more helpful than the logical-only operators..?Perhaps we should ask then why logical-only operators ignore undef, but not why other operators don't ignore it.
I just think of the amount of code out there that is written to avoid those warnings.Really?
a code to just avoid warning;$x = '' unless defined($x)
a code to avoid bug:my $x = '';
So you see 1st case in your code?defined($x) or confess;
a code which catches bug:mysub($user_data) { $user_$data->{invoice_number} ... } mysub({age => $user_age, inovice_number = $invoice_number}) # TYPO!
mysub($user_data) { defined($user_$data->{invoice_number}) or confess; $user_$data->{invoice_number} ... } mysub({age => $user_age, inovice_number = $invoice_number}) # TYPO!
In reply to Re^3: Do people find warning for undef with string compare useful?
by vsespb
in thread Do people find warning for undef with string compare useful?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |