in reply to convert to binary number

Is your number an integer? Is it stored in a file, in a perl variable, the perl code, or other? Do you want to address individual bits in the result, or do you want to display it on your screen? Write it to a file? Or other? You probably have already received the right answer. All you have to do is choose the one that guessed the right answers to these questions. That may not be easy. I suggest that you tell us what you want to accomplish. It probably can be done without your conversion at all. If it is required, we will be able to give you the answer that best fits your real needs.
Bill

Replies are listed 'Best First'.
Re^2: convert to binary number
by Anonymous Monk on Jun 05, 2017 at 23:16 UTC

    I'm just a hobbyist, what i am trying to accomplish at this time is writing a script that converts normal numbers into binary ones. With your help it's working.