in reply to Re^2: Checking for the existence of a passed parameter.
in thread Checking for the existence of a passed parameter.

But your code generates warnings when comparing $verify to 'yes' if it's also undef, unless you're absolutely sure that your code doesn't fall out the bottom. I'd write that like this, if you wanna flatten the nesting:
if (not defined $foo) { ... undef ... } elsif ($foo eq 'yes') { ... yes ... } else { ... everything else ... }

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^4: Checking for the existence of a passed parameter.
by Aristotle (Chancellor) on Nov 11, 2003 at 20:34 UTC

    That's why I commented that there should be a "return, exit, last, or whatever" at the end of the first block. Your version is what I should have arrived at, though.

    (I was actually going for a single-if-series solution, but don't know why it didn't occur to me to check the definedness up front. I was irked by having to defined $foo and ... in all conditions before the else-block. Heh. I'm embarrassingly slow lately.)

    Makeshifts last the longest.