devel/p5-enum 1.12v0 OpenBSD
C style enumerated types and bitmask flags
- System
- OpenBSD
- Repository
- OpenBSD ports
- Maintainer
- The OpenBSD ports mailing-list <[email protected]>
- Categories
- devel, perl5
Description
Defines a set of symbolic constants with ordered numeric values ala C enum types. What are they good for? Typical uses would be for giving mnemonic names to indexes of arrays.
This not only reads easier, but can also be typo-checked at compile time when run under use strict. That is, if you misspell Days_Fri as Days_Fry, you'll generate a compile error.
Also capable of creating ordered bitmask constants, allowing the easy creation of bitmask constants, allowing you to efficiently store many true/false options within a single integer.
In the other systems
| System | Port | Version |
|---|---|---|
| OpenBSD | devel/p5-enum | 1.12v0 |
| FreeBSD | devel/p5-enum | 1.110 |
| NetBSD | devel/p5-enum | 1.120nb5 |
| DragonFly | devel/p5-enum | 1.110 |
| HardenedBSD | devel/p5-enum | 1.110 |
| GhostBSD | devel/p5-enum | 1.110 |
Install
Binary package:
pkg_add p5-enum
From the ports tree:
cd /usr/ports/devel/p5-enum && make install