I have this code of converting hexadecimal value to decimal but getting a warning at compilation. I'm starting to learn Perl and this one really makes me - almost - crazy! :)
#!/usr/bin/perl use strict; use warnings; my $decVal; print "Please enter a hexadecimal value to be converted to decimal: "; $decVal = <STDIN>; print "The value in decimal is: ", hex($decVal), "\n";
When I try to compile it:
Sproky: $ perl hexoct2dec2.plx
Please enter a hexadecimal value to be converted to decimal: 30
Illegal hexadecimal digit '
' ignored at hex2dec2.plx line 11, <STDIN> line 1.
The value in decimal is: 48
Anyone to shed some light please??