KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I would like to represent a set in Perl. What I usually do is using a hash with some dummy value, e.g.: my %hash=(); $hash{"element1"}=1; $hash{"element5"}=1; Then use if (defined $hash{$element_name}) to decide whether an element is in the set. Is this a common practice? Any suggestions on improving this? Also, should I use defined or exists ? Thank you
Tags (comma-separated)
Save Edits
Cancel