Hi all, I am running through a good book on Perl and am having some issues with a script I am trying to create for one of the practice exercises (I am teaching myself Perl for work). Just to let you know the solution does not involve using an if statement because this is in the next chapter.
The objective is to "Write a program that asks for a decimal less than 256 and converts it to binary." Any help would be greatly appreciated! #!/usr/bin/perl # dec-less-than-exercise.pl use strict; use warnings; print "Decimal Less Than 1.0\n\nPlease enter a decimal number less than 256: "; chomp(my $dec = <STDIN>); $dec = $dec < 256; print $dec, "is less than 256! ", "\n"; $dec = oct($dec); print $dec, "is your binary value. ", "\n"; Ryan Munson