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\
That's how I've always done it. I would tend to use exists rather than defined but they should both work in this context.
exists
defined