in reply to use base and inheritance of non-method subroutines

While I don't think that there is a general solution to this problem. Here is an expample of a very hard case.
package A; use Data::Dumper (); sub Dumper { print "This is not dumper\n"; }
However if you make some assumptions you can get something that works (or gets close to it).
package ibase; BEGIN { require base; *{"_import"} = \&{"base::import"}; for (qw( )) { *{"$_"} = \&{"base::$_"}; } } our $ExportLevel = 0; sub import { my $self = shift; my $callpkg = caller($ExportLevel); eval { $self->_import(@_); }; for my $key (keys %INC) { if ($key =~ m|Data/Dumper.pm|) { *{"$callpkg\::Dumper"} = \&{"Data::Dumper::Dumper"}; } } } 1;
Then use ibase rather than base.
package A; use Data::Dumper; print Dumper \%INC, \@INC; package B; use strict; use ibase 'A'; print Data::Dumper::Dumper(\%A::INC, \%INC); print Dumper([1]);
You code make this a little more robust buy using @EXPORT_OK to see what all should be imported.
-- gam3
A picture is worth a thousand words, but takes 200K.