I tried the following:
package Mod; sub foo { print "Output: @_\n"; } sub import { my ($pkg, %options) = @_; __PACKAGE__->foo(arg => $options{-arg}); } 1;
Result:
> perl -e 'use Mod -arg => "custom";' Output: Mod arg custom
No dying at all.
In reply to Re: use, require, import and use arguments
by jethro
in thread use, require, import and use arguments
by djihed
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |