Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: decimal to binary

by Khen1950fx (Canon)
on Jan 09, 2012 at 07:34 UTC ( [id://946957]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub dec2bin { 
        my $str = unpack('B32', pack('N', shift)); 
        $str =~ s/^0+(?=\d)//; 
        return $str;
    }
    
  2. or download this
    #!/usr/bin/perl -l
    
    ...
        $str =~ s/^0+(?=\d)//; 
        return $str;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-03-29 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found