> $addr4=$abbrevs{$addr4} if (defined $abbrevs{$addr4});

I think you might want to use "exists" instead of "defined" in this case, or
maybe both depending on what you are trying to do.

$addr4=$abbrevs{$addr4}
 if (exists $abbrevs{$addr4} and defined $abbrevs{$addr4});

Rob


-----Original Message-----
From: Gary Stainburn [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 7:25 AM
To: [EMAIL PROTECTED]
Subject: unexpected runtime error


Hi folks,

I'm getting:

Use of uninitialized value in hash element at /home/gary/bin/svcimport line 
188, <FIN> line 4301.

when running my program, of which like 188 is:

  $addr4=$abbrevs{$addr4} if (defined $abbrevs{$addr4}); # expand 
abbreviations

Surely the 'if defined' should prevent this from happening by checking that
it 
is in fact initialized.  BTW, I'm not getting it for every input line, but 
for a significant number.
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to