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-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b71f1e8073bc3bbce9d3c3bfad33f6a2117c4b49;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]';