my $foo = "4D"; my $bar = "\x$foo"; print $bar . "\n"; Illegal hexadecimal digit '$' ignored at roman.pl line 7. 4D