Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: having trouble unmasking a binary string

by Cristoforo (Deacon)
on Mar 28, 2013 at 03:09 UTC ( #1025838=note: print w/ replies, xml ) Need Help??


in reply to having trouble unmasking a binary string

At this point
$binPet =~ s/^0+(?=\d)//;
$binPet contains the string '10' and then when you print out that string in
printf "%s%bn%s", "\n", $binPet, "\n";, it gives the binary representation of ten, (1010), not a binary '2', (0b10).

And I don't know the purpose of 'n' in the printf format string, "%s%bn%s".

Beyond that, I'm not sure of what to tell you - the purpose of the code.


Comment on Re: having trouble unmasking a binary string
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-12-20 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls