Closed p5pRT closed 20 years ago
'use autouse' (Perl 5.6.1) works like this:
use autouse AA => 'AA::new';
but not like this:
use autouse AA::BB => 'AA::BB::new';
I get a complaint saying:
autouse into different package attempted at autouse.pl line 5
This appears to be because of the line in autouse.pm that gets the index of the '::' in the function name.
My proposed fix for this problem changes the index() call into a rindex() call:
- my $index = index($func\, '::'); + my $index = rindex($func\, '::'); if ($index == -1) { $closure_import_func = "${callpkg}::$func"; } else { $closure_func = substr $func\, $index + 2; croak "autouse into different package attempted" unless substr($func\, 0\, $index) eq $module; }
Already been fixed. :) Next version of perl will have it.
Migrated from rt.perl.org#7115 (status was 'resolved')
Searchable as RT7115$