Either I'm missing something... or there's a little something missing here (like assigning a value to @array):

C:\>1071258.pl 3 Argument "" isn't numeric in numeric ge (>=) at 1071258.pl line 8, <ST +DIN> line 1.
where line 8 in my code reflects inclusion of hashbang, etc... and contains while ($inputNumber>=1) and is Ln 4 in OP.

Update: The node at http://www.perlmonks.com/index.pl?node_id=1071258, the parent of this post, has disappeared (been deleted? by Q&AEditors?) as of approx 0700 Eastern US, 20 Jan 2014, and this reply node contains no link to OP (nor does morgon's similar reply). So, for the record, the OP contained what follows, minus the hashbang, pragmas and source-identifying comment:

#!/usr/local/bin/perl use 5.016; use warnings; # 1071258 (Q&A: convert between decimal and binary) chomp (my $inputNumber = <STDIN>); my @array; while ($inputNumber>=1) { my $remainder; my $quo; if ($inputNumber == 1) { unshift @array,$inputNumber; last; } $remainder = $inputNumber % 2; print "Remainder = $remainder\n"; $quo = $inputNumber / 2; print "Quo = $quo\n"; unshift @array,$remainder; $inputNumber = $quo; } print"\n"; print @array; print"\n";
Come, let us reason together: Spirit of the Monastery

In reply to Re: Answer: How do I convert between decimal and binary? by ww
in thread How do I convert between decimal and binary? by vroom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.