in reply to Checking for defined-ness for a list

if (! grep defined($_), @hash{ qw(A B C) } ) { # etc }

UPDATE
merlyn is exactly right. Why you shouldn't try to answer with untested code while racing back to chatter...

Replies are listed 'Best First'.
Re: Re (tilly) 1: Checking for defined-ness for a list
by merlyn (Sage) on Jul 25, 2001 at 20:15 UTC
    I think demorgan got the best of you here. This is "all are undefined", not "at least one undefined". You want:
    if (grep !defined($_), @hash{ qw(A B C) }) { # at least one undefined }

    -- Randal L. Schwartz, Perl hacker