in reply to Re: stuck with a \N{CHAR NAME} problem
in thread stuck with a \N{CHAR NAME} problem

Alias games aside, I have yet to read any argument for why \N{NAME} should not simply use the currently active charmap, and/or autoload the :full one. This would handle all but the rarest sitatuations, and it would make Perl stop violating the principle of least surprise. In other words, instead of generating an exception like
Constant(\N{NAME}) unknown: (possibly a missing "use charnames ...")
It should in that situation implicitly do a
use charnames ":full";
and get on with it. In other words, if you need a charmap and don't have one, just load what everybody is expecting.

Replies are listed 'Best First'.
Re^3: stuck with a \N{CHAR NAME} problem
by ikegami (Patriarch) on May 26, 2011 at 18:28 UTC

    Auto-loading :full would be most desireable, but it wouldn't help here.

    It seems to me the OP's issue could be resolved by attaching charnames data to statements (just like strict flags). Then, qr// could translate \N{NAME} to \N{U+NUM} at run-time just like it does at compile-time. That would even handle aliases. Is that hard to do?