S
Sam
I am following an online study to learn Perl.
I wrote my first 2 programs and run them but unable to find what's wrong
with them.
the first is as bellow it prints a "\n" in the output right after the $nmber
so that converts to ... is on a new line. why?
#!/usr/bin/perl -w
use strict;
print "please type a hexadecimal number\n";
print "it should starts with 0x and ends with a character less than F: ";
my $nmber= <STDIN>;
print "\$$nmber converts to decimal number: ", hex("$nmber"), "\n";
I wrote my first 2 programs and run them but unable to find what's wrong
with them.
the first is as bellow it prints a "\n" in the output right after the $nmber
so that converts to ... is on a new line. why?
#!/usr/bin/perl -w
use strict;
print "please type a hexadecimal number\n";
print "it should starts with 0x and ends with a character less than F: ";
my $nmber= <STDIN>;
print "\$$nmber converts to decimal number: ", hex("$nmber"), "\n";