in reply to What CPAN Modules are Good to Learn From?
but its import function is 100 lines long and places various weird restrictions on constant names.package constant; sub import { shift; die if @_ % 2; # probably a mistake my $caller = caller; while (my ($k, $v) = splice @_, 0, 2) { *{"$caller\::$k"} = sub () { $v }; } }
If you want to learn from CPAN modules, I suggest looking at some of the newer, simpler ones, like ADAMK's ::Tiny modules.
|
|---|