This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix my constant $var utf8 confusion
authorFather Chrysostomos <sprout@cpan.org>
Fri, 5 Sep 2014 20:53:00 +0000 (13:53 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 5 Sep 2014 21:16:54 +0000 (14:16 -0700)
commit42d532a64cfb4c36e68f8ff06cb4ca1c76299463
tree5bd74a84dc83bc5b674a785a5de27506aa6472c5
parent82947af8f50ec744d93ebd93fecddb9fa6e97e4c
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.
t/uni/lex_utf8.t
toke.c