| 1 | package CXC::PDL::Bin1D::Utils; | ||
| 2 | |||
| 3 | 5 | ▶ | use v5.10; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 5 | ▶ | use Exporter 'import'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 5 | our $VERSION = '0.28'; | |
| 10 | |||
| 11 | 5 | our @EXPORT_OK = qw[ _bitflags _flags ]; | |
| 12 | |||
| 13 | 0 | ▶ | sub _bitflags { |
|
Subroutine
_bitflags: not called CC=1 SCAR=6.9
| |||
| 14 | 0 | my $bit = 1; | |
| 15 | ## no critic (BuiltinFunctions::ProhibitComplexMappings) | ||
| 16 | 0 | return shift(), 1, map { $bit <<= 1; $_ => $bit; } @_; | |
| 17 | } | ||
| 18 | |||
| 19 | 0 | ▶ | sub _flags { |
|
Subroutine
_flags: not called CC=3 SCAR=24.8
| |||
| 20 | 0 | my $bits = shift; | |
| 21 | 0 | croak( "unknown flag: $_ " ) for grep { !defined $bits->{$_} } @_; | |
| 22 | 0 | my $mask; | |
| 23 | 0 | $mask |= $_ for @{$bits}{@_}; | |
| 24 | 0 | return $mask; | |
| 25 | } | ||
| 26 | |||
| 27 | 5 | 1; | |
| 28 | |||
| 29 | __END__ | ||