This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix my constant $var utf8 confusion
‘my some_constant $var’ tries to resolve some_constant to a package
name and then look that up, but, when using the value of the constant
to do a stash lookup, it was applying the utf8 flag if ‘use utf8’ was
in scope, even if the constant wasn’t utf8:
$ ./perl -Ilib -e 'use constant foo=>qq|\xc4\xb5|; BEGIN{${"\xc4\xb5::foo"}}; my foo $dog; print "ok\n"'
ok
$ ./perl -Ilib -e 'use constant foo=>qq|\xc4\xb5|; BEGIN{${"\xc4\xb5::foo"}}; use utf8; my foo $dog; print "ok\n"'
No such class foo at -e line 1, near "; my foo"
Execution of -e aborted due to compilation errors.