Permalink
Browse files

Fix warnings in perl-5.16.0. (RT #74511)

See https://rt.cpan.org/Ticket/Display.html?id=74511 .

The problem was that a \u (ucfirst) was followed by an \E, which should
not be used after that. Thanks to ANDK for the report.
  • Loading branch information...
1 parent 03b93ad commit 970e0da7125219ee56e6af1db7dda3e77a5b710f @shlomif committed May 11, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/IO/All.pm
View
@@ -73,16 +73,18 @@ sub autoload_class {
my $self = shift;
my $method = shift;
my $class_id = $self->autoload->{$method} || $method;
- return "IO::All::\u$class_id" if $INC{"IO/All/\u$class_id\E.pm"};
+ my $ucfirst_class_name = 'IO::All::' . ucfirst($class_id);
+ my $ucfirst_class_fn = "IO/All/" . ucfirst($class_id) . ".pm";
+ return $ucfirst_class_name if $INC{$ucfirst_class_fn};
return "IO::All::\U$class_id" if $INC{"IO/All/\U$class_id\E.pm"};
require IO::All::Temp;
- if (eval "require IO::All::\u$class_id; 1") {
- my $class = "IO::All::\u$class_id";
+ if (eval "require $ucfirst_class_name; 1") {
+ my $class = $ucfirst_class_name;
my $return = $class->can('new')
? $class
: do { # (OS X hack)
- my $value = $INC{"IO/All/\u$class_id\E.pm"};
- delete $INC{"IO/All/\u$class_id\E.pm"};
+ my $value = $INC{$ucfirst_class_fn};
+ delete $INC{$ucfirst_class_fn};
$INC{"IO/All/\U$class_id\E.pm"} = $value;
"IO::All::\U$class_id";
};

0 comments on commit 970e0da

Please sign in to comment.