in reply to Re^3: Breaking The Rules
in thread Breaking The Rules

if ($var eq undef) { ... } elsif ($var eq '') { ... } elsif ($var eq 'foo') { ... };

As noted several times, 'eq' isn't "equals" it is "string equals" (and '==' is "number equals"). If you want to compare to 'undef', then you want 'given' (or 'when' or '~~', Perl6isms that'll appear in Perl5 soon enough -- I'd say more but searching for "given" is pretty useless, since I see patches to add them already being applied).

- tye