in reply to Warnings, and declaring Hashes of Hashes.
Cheers,
Ovid
Update: I tested your method of looking up hash elements and it appears to work:
However, it is definitely not how it's usually done and I suspect you'll find that most agree that using the $ first is preferable. Not sure if there are any issues with the other way.use warnings; my %hash1 = ( test => 3 ); my %hash2 = ( bobby => 15, what => 'thehell' ); print "good\n" if %hash1->{'test'} < %hash2->{'bobby'}; print "good1\n" if $hash1{'test'} < $hash2{'bobby'};
Also, just because you have a particular key in existence does not mean that it's defined.
Make sure that %USERLIST->{...} is changed to $USERLIST{...}.
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Ovid) Re: Warnings, and declaring Hashes of Hashes.
by japhy (Canon) on Nov 30, 2000 at 04:11 UTC | |
by snax (Hermit) on Nov 30, 2000 at 15:09 UTC | |
by tilly (Archbishop) on Nov 30, 2000 at 17:17 UTC | |
by snax (Hermit) on Nov 30, 2000 at 19:06 UTC | |
|
Re: (Ovid) Re: Warnings, and declaring Hashes of Hashes.
by BatGnat (Scribe) on Nov 30, 2000 at 02:52 UTC |