package Bar; sub import { my $class = shift; if (@_) { my $x = shift; # passed from Foo warn "$class: got '$x' from ".caller()."\n"; # now do whatever you like with 'x' } } # more stuff... 1;