http://qs321.pair.com?node_id=11144669


in reply to Problem with escape sequence \x for hex with spaces "\x{ 263A }"

G'day Rolf,

That feature was introduced in v5.34: "perl5340delta: Blanks freely allowed within but adjacent to curly braces".

My tests:

$ alias perle alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E +' $ perlbrew switch perl-5.32.0 $ perle 'say $]; say join ",",map {ord} split //, $_ for "\x{ 41 }", " +\x{41}", "\x{263A}", "\x{ 263A }"; say for "\x{41}", "\x{ 41 }"' Non-hex character ' ' terminates \x early. Resolved as "\x{00}" at -e + line 1. Non-hex character ' ' terminates \x early. Resolved as "\x{00}" at -e + line 1. Non-hex character ' ' terminates \x early. Resolved as "\x{00}" at -e + line 1. 5.032000 0 65 9786 0 A $ perlbrew switch perl-5.34.0 $ perle 'say $]; say join ",",map {ord} split //, $_ for "\x{ 41 }", " +\x{41}", "\x{263A}", "\x{ 263A }"; say for "\x{41}", "\x{ 41 }"' 5.034000 65 65 9786 9786 A A

It's not mentioned in perlop, so a doco omission but not a bug in Perl itself. Perhaps raise a doco bug report.

— Ken