[EMAIL PROTECTED] wrote:
%a = (
   "a" => 1,
   "b" => 2,
   "c" => 3
);

$searchKey = "a";

print "Found $searchKey" if defined($a{$searchKey});

Try that with this hash:

my %a = (
    a => undef,
    b => undef,
    c => undef,
    );

defined() does not tell you if a key exists.

perldoc -f exists


John -- use Perl; program fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to