|
|
|
|
|
by lizmat
394 days ago
|
|
Actually, a module can implement any export heuristics by supplying an EXPORT subroutine, which takes positional arguments from the `use` statement, and is expected to return a Map with the items that should be exported. For example: sub EXPORT() { Map.new: "&frobnicate" => &sum }
would import the core's "sum" routine, but call it "frobnicate" in the imported scope.Note that the EXPORT sub can also be a multi, if you'd like different behaviour for different arguments. |
|