Thanks for all the reports!
rt.cpan.org is a correct place to report bugs, and there's no need to move
these, but it is easier for us to work with you if they are reported via
Github. In the future, consider using this link to report instead.
https://github.com/schwern/Method-Signatures/issues
On 2012.11.23 1:21 AM, Lukas Mai via RT wrote:
Show quoted text> $ cat unicode1
> #!perl
> use utf8;
> use Method::Signatures;
>
> func foo($neé) {}
> __END__
> $ perl unicode1
> Can't call method "prune" on an undefined value at
> /home/mauke/usr/lib/perl5/site_perl/5.16.2/Method/Signatures/Parser.pm
> line 19.
This one I can replicate. That error is due to PPI failing to parse the
argument list. The error from PPI is Fatal error... regex failed to match in
'é ' when expected at
/Users/schwern/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/PPI/Token/Word.pm
line 416.
I suspect what's happening is PPI is looking at $neé, sees $ne as a scalar and
then doesn't know what the following é is. However, PPI seems to be able to
figure out a utf8 encoded string just fine.
$ perl -wle 'use PPI; { use utf8; $proto = q[$neé]; } my $ppi =
PPI::Document->new(\$proto); print $ppi; print PPI::Document->errstr'
$ne?
It's only when it sees a UTF8 which hasn't been declared UTF8 that it messes up.
$ perl -wle 'use PPI; { $proto = q[$neé]; } my $ppi =
PPI::Document->new(\$proto); print $ppi; print PPI::Document->errstr'
Use of uninitialized value $ppi in print at -e line 1.
Fatal error... regex failed to match in 'é ' when expected at
/Users/schwern/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/PPI/Token/Word.pm
line 416.
Looking at the prototype with Devel::Peek confirms, there's no UTF8 flag on
the prototype. We're losing it somewhere along the way. That somewhere
appears to be inside Devel::Declare::get_linestr(). Source lines are coming
out of it without the UTF8 flag. We'll have to put together a simple example
using Devel::Declare and report it upstream.
Show quoted text> $ cat unicode2
> #!perl
> use utf8;
> use Method::Signatures;
>
> func naïve() {}
> naïve();
> __END__
> $ perl unicode2
> Undefined subroutine &main::naïve called at unicode2 line 6.
This one I can't replicate.