BEGIN { require Foo; Foo->import("-bar"); }; #### package Foo; use strict; use warnings; sub import { warn "@_"; }; 1; #### package Foo; use strict; use warnings; use parent qw(Exporter); our @EXPORT_OK = qw(quux); sub import { warn "@_"; if (grep { /-bar/ } @_) { __PACKAGE__->export_to_level(1, undef, "quux"); }; }; sub quux { return 42; }; 1;