> Wait. Are you saying that if someone has "use feature bitwise in their header, then this code fails?
If it's in the same scope, yes.
Not sure what header means for you.
> Can I write "no feature 'bitwise';" inside binary2decimal() to make sure it doesn't misbehave?
Theoretically yes, try it out.
Better use feature bitwise and change the operator to |. ... But this wouldn't work in older Perl.
So in case backwards compatibility is an issue, maybe no combined with if Version >...
In general, if someone was copying that code into his scope, you shouldn't be bothered about their fate. It's their responsibility.
The right approach of sharing code is to use modules, not boilerplating.
|