Re: comparing hash values

2001-08-25 Thread Marcus Holland-Moritz
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

Re: comparing hash values

2001-08-21 Thread Michael Fowler
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

RE: comparing hash values

2001-08-21 Thread Wagner-David
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