in reply to Re: Do people find warning for undef with string compare useful?
in thread Do people find warning for undef with string compare useful?

Unfortunately, // has lower priority than eq. You code is equivalent to
if ($possibly_undef) { ...

The correct syntax is

if (($possibly_undef // '') eq 'Hello') { ...
Which blows up the code size and makes it less readable.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^3: Do people find warning for undef with string compare useful?
by smls (Friar) on May 31, 2013 at 22:41 UTC
    Ah yes, you're right of course.