Subject: | Uninitialized value warning from Encode->encodings() |
The docs document this as a method call, but if you call it as a method
with no additional arguments you get:
Use of uninitialized value $_[1] in string eq at
/home/autarch/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/x86_64-
linux/Encode.pm line 65.
The problem is this code:
if ( @_ and $_[1] eq ":all" ) { ... }
When called as a method, @_ is always true.
The rest of the internals seem to suggest that you _don't_ expect this
sub to be called as a method, since you access "@_" without shifting
anything off.
I think you really need to shift off the first argument like you were
doing before, either that or document this as a backwards incompatible
change and document calling this as a sub, not a method. But this seems
like something that's not worth breaking back compat for.