The closest thing that I can think of is Data::Rlist. What you are asking sounds a bit like an enum. This discussion might be useful: How can I create an enum type in Perl?
In reply to Re: Restricting a scalar to certain values
by jakeease
in thread Restricting a scalar to certain values
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |