in reply to comparing two values under 'perl -w'

What about?
if (!(defined $a && defined $b) || $a eq $b) { print "equal"; }

gav^

Replies are listed 'Best First'.
Re: Re: comparing two values under 'perl -w'
by kappa (Chaplain) on Apr 02, 2002 at 16:16 UTC
    What if $a = undef and $b = 3?
    We get equal?