in reply to undef-safe equality
Here's a shorter version (compared to the others I saw posted):
sub iseq { return defined($_[0]) == defined($_[1]) && $_[0] eq $_[1]; }
Update: Drat. You can't get away with that shortcut and still avoid the warning.
- tye
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: undef-safe equality (shorter)
by Roy Johnson (Monsignor) on Apr 21, 2005 at 22:11 UTC |
In Section
Seekers of Perl Wisdom