in reply to Freed From the Tyranny of Math::BigInt
To retain the feature of having permits return not just a true or false value, but a usable bitmask of those permissions that were satisfied (untested):sub permits { my ($self, $mask) = @_; return (($self->{perms} & $mask) =~ y/\0//c); }
sub permits { my ($self, $mask) = @_; $mask &= $self->{perms}; return ($mask =~ y/\0//c ? $mask : ""); }
|
|---|