in reply to Exporter. Correct way to override import?
Exporter uses caller or similar to determine to which package to export. The caller is in package Foo in your example, which is why it's failing. You want
orsub import { ... Exporter->export_to_level(1, @_); ... }
sub import { ... goto &Exporter::import; }
Get rid of archaic our @ISA = 'Exporter';. It doesn't make sense, and it hasn't been necessary since 5.8.3 (2004).
|
|---|