in reply to What does "-" in a use statement do?

Hello nysus,

use Foo -bar; is essentially
BEGIN { require Foo; Foo->import("-bar"); };
You can define your own import sub, just like follows:
package Foo; use strict; use warnings; sub import { warn "@_"; }; 1;
Furthermore, you can use Exporter:
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;

And this will suddenly export quux to the calling package, despite having "-bar" in the use statement.

No magic there, just a lot, A LOT of silent conventions.