title: How do I convert decimal numbers to binary in Perl?
body: <p>I am trying to make a program that converts decimal numbers or text into binary numbers in Perl. The program asks for user input of a character or string and then prints out the result to the console. How do I do this? My code I have been working on is below, but I cannot seem to fix it.</p>
  
  <pre><code>print "Enter a number to convert: ";
  chomp($decimal = &lt;STDIN&gt;);
  print "\nConverting $number to binary...\n";
  $remainder = $decimal%2;
  while($decimal &gt; 0)
  {
      $decimal/2;
      print $remainder;
  }
  </code></pre>