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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |