# this handles 'use base "MyOOModule"' # which doesn't call 'import' { my ($level, $prev, $pkg); while (my ($curr) = caller $level++) { $pkg = $curr, last if $prev and $prev eq "base" # NB: base.pm shows and $curr ne "base"; # up twice in a row $prev = $curr; } __PACKAGE__->export_to_level($level, $pkg, @EXPORT) if $pkg; }