> $ perl -wle'"a\x1"=~s/a(?=\x1)//' > Illegal hexadecimal digit ')' ignored at -e line 1. > Illegal hexadecimal digit ')' ignored at -e line 1. > Can't modify constant item in substitution (s///) at -e line 1, at EOF > Execution of -e aborted due to compilation errors. > > The documented syntax for hex escapes is \xHH > > * Why do I get a double warning > * Why does the assignment not warn > > $ perl -wle'$_="a\x1)"' > Illegal hexadecimal digit ')' ignored at -e line 1. > > Here it *does* warn > > Same behaviour in 5.8.8 > (also said on #p5p) $_="a\x1"; does not warn since there are no characters after the 1. m/a\x1/; also does not warn If we look at octal: $ perl -wle 'print "\01A";' A $ perl -wle 'print "\018";' Illegal octal digit '8' ignored at -e line 1. 8 Doing a similar thing for hex should be possible (only warn if the symbol is in the [G-Zg-z] range) but I personally see very little value in this warning. A warning about \018 is useful since the user might be confusing decimal with octal... But with what can you possible confuse \x1Z ? Kind regards, Bram