|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: Script critique requestedby aitap (Chaplain) |
| on Oct 04, 2012 at 17:39 UTC ( #997275=note: print w/ replies, xml ) | Need Help?? |
|
Unfortunately, this is alot easier. First of all, you could use some loop starting with multiplying a variable by 2, like this:
Secondly, you can just use pack and unpack instead: print unpack ("B8", (pack "c",$dec)); Explanation: pack the number as a signed char value (0..255) in a byse sequence and unpack as 8 bits.
Sorry if my advice was wrong.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||