NAME Bitmask::Data - Handle bitmasks in an easy and flexible way
SYNOPSIS # Create a simple bitmask class packacke MyBitmask; use
base qw(Bitmask::Data); __PACKAGE__->bitmask_length(18);
__PACKAGE__->bitmask_default(0b000000000000000011);
__PACKAGE__->init( 'value1' => 0b000000000000000001, 'value2' =>
0b000000000000000010, 'value2' => 0b000000000000000100, 'value4'
=> 0b000000000000001000, 'value5' => 0b000000000000010000, ...
); ## Somewhere else in your code use MyBitmask; my $bm =
MyBitmask->new('value1','value3'); $bm->mask; DESCRIPTION This
package helps you dealing with bitmasks. First you need to
subclass Bitmask::Data and set the bitmask values and length.
(If you are only working with a single bitmask in a simple
application you might also initialize the bitmask directly in
the Bitmask::Data module). After the initialization you can
create an arbitrary number of bitmask objects which can be
accessed and manipulated with convenient methods. METHODS Class
Methods bitmask_length Set/Get the length of t