Hey guys, I've heard you're the ones to go to if in need of help with anything perl-related. Well, I have a question for you. First look at this part of my code:

#!/usr/bin/perl #intconv2.plx use warnings; use strict; print "Please enter a normal decimal number less than 256: ", "\n"; my $dec; $dec=<STDIN>; my$binc1=$dec&128; if ($binc1!=0) { our$bin1=1; } else { our$bin1=0; } print"The number in binary is: $bin1 \n";

I know this isn't a correct way of converting from decimal to binary but as I said this is only part of my code. My problem is that I get an error saying "Variable "$bin1" is not imported at C:\PerlScripts\intconv2.plx line 90. Global symbol "$bin1" requires explicit package name at C:\PerlScripts\intconv2.plx line 90. I thought this meant that the variable $bin1 I declared was not global and I don't know how to fix this, unless that's not even the problem. Please help me.


In reply to Need a little coding help by samaniac

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.