From: Graham Knop Date: Mon, 3 Oct 2016 23:08:56 +0000 (-0400) Subject: glob names need to be encoded in older perls X-Git-Tag: v0.22~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a24a624977b29cacd9a9afdc7644395be55ebcb5;hp=63be23c8914e4741b2e25607a65fb77db9092edd;p=p5sagit%2FSub-Name.git glob names need to be encoded in older perls --- diff --git a/t/exotic_names.t b/t/exotic_names.t index 621cad6..6a5e28e 100644 --- a/t/exotic_names.t +++ b/t/exotic_names.t @@ -104,8 +104,10 @@ for my $ord (@ordinal) { no strict 'refs'; *palatable:: = *{"aliased::native::${pkg}::"}; # now palatable:: literally means aliased::native::${pkg}:: - ${"palatable::$subname"} = 1; - ${"palatable::"}{"sub"} = ${"palatable::"}{$subname}; + my $encoded_sub = $subname; + utf8::encode($encoded_sub) if "$]" < 5.016 and $ord > 255; + ${"palatable::$encoded_sub"} = 1; + ${"palatable::"}{"sub"} = ${"palatable::"}{$encoded_sub}; # and palatable::sub means aliased::native::${pkg}::${subname} } $sub = compile_named_sub 'palatable::sub' => '(caller(0))[3]';