http://qs1969.pair.com?node_id=186551

RollyGuy has asked for the wisdom of the Perl Monks concerning the following question:

I'm using a SWIG interface to C++ on one of my projects at work. On the C++ side, we have a 32-bit integer where the different bits represent different (named) settings. We're using perl as the interface to C++ and would like an easy way to set (and unset) these bits using named constants. In C++ there are Enumerated values that give me that functionality. Is there anything like that in perl?

Is there a good way to do this?