Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
from the following code:Illegal hexadecimal digit ' ' ignored at G:\Beta\Trap_Tool\hex.pl line 9.
#!/usr/bin/perl use warnings; use strict; my $num = "0x10000000"; for (0..5) { my $dec_num = sprintf("%d", hex("$num")); print "DEC: $dec_num\n"; $dec_num ++; my $hex_num = sprintf "0x" . "%x\n", $dec_num; print "HEX: $hex_num\n"; $num = "$hex_num"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Illegal hexadecimal digit error
by Abigail-II (Bishop) on Jul 07, 2003 at 14:40 UTC | |
(jeffa) Re: Illegal hexadecimal digit error
by jeffa (Bishop) on Jul 07, 2003 at 14:40 UTC | |
by tadman (Prior) on Jul 07, 2003 at 17:43 UTC | |
Re: Illegal hexadecimal digit error
by dws (Chancellor) on Jul 07, 2003 at 16:37 UTC |