in reply to Re^10: How can I set a bit to 0 ?
in thread How can I set a bit to 0 ?
you mean any sub with empty prototype which is the way how constants are implemented in constant
see https://perldoc.perl.org/perlsub#Constant-Functions °
and the OP's code still compiles even if your return values are not constant.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
°) NB:
sub FLAG_MASK () { FLAG_FOO | FLAG_BAR } sub FOO_SET () { 1 if FLAG_MASK & FLAG_FOO }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^12: How can I set a bit to 0 ?
by hippo (Archbishop) on May 27, 2022 at 16:11 UTC | |
by LanX (Saint) on May 27, 2022 at 17:05 UTC |