You can check if a key is already in a hash table with Perl's exists()
function.
Have a look at 'perldoc -f exists' for details.
Hope this helps.
-- Marcus
- Original Message -
From: "Darfler, Jim (J.E.)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 21, 2001 8:05 PM
On Tue, Aug 21, 2001 at 11:12:55AM -0700, Wagner-David wrote:
> You can do:
>
> if ( exists $hash{$Key} ) {
> # the key exists, so do your check
>}else {
> # key does not exist, so add to hash
>}
>
> Also can use defined, but depe
You can do:
if ( exists $hash{$Key} ) {
# the key exists, so do your check
}else {
# key does not exist, so add to hash
}
Also can use defined, but depending on how accessing there is
auto-vivfying(sp), which may create(i