in reply to Re: How to check if a variable's value is equal to a member of a list of values
in thread How to check if a variable's value is equal to a member of a list of values
And if the hash happens to grow too big, you can tie it to an optimized cached on disk hash using DB_File, BerkeleyDB or similar module.
One thing though, it's not necessary to store the 1 in the values. Keep them empty and use exists()
my %set; @set{@values} = (); ... if (exists $set{$key}) ...
Update: Fixed a syntax error (incorrect type of parens). Thanks go to choroba.
Jenda
Enoch was right!
Enjoy the last years of Rome.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to check if a variable's value is equal to a member of a list of values
by cls33 (Novice) on Mar 25, 2013 at 15:24 UTC | |
by LanX (Saint) on Mar 25, 2013 at 15:36 UTC | |
by choroba (Cardinal) on Mar 25, 2013 at 15:37 UTC | |
by cls33 (Novice) on Mar 25, 2013 at 16:30 UTC | |
by choroba (Cardinal) on Mar 25, 2013 at 16:35 UTC |