Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^12: converting binary to decimal

by LanX (Saint)
on Jun 08, 2025 at 16:02 UTC ( [id://11165316]=note: print w/replies, xml ) Need Help??


in reply to Re^11: converting binary to decimal
in thread converting binary to decimal

> 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.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11165316]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2025-12-11 14:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (92 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.