Despite the Perl6::Export::Attrs pod, IMPORT should just be a plain old sub.
sub IMPORT { ... }
Here's a full example:
use 5.010; use strict; { package Local::MyTest; no thanks; use Perl6::Export::Attrs; sub foobar :Export(:DEFAULT) { return 1; } sub IMPORT { say "in the IMPORT block! Got: @_"; } } use Local::MyTest qw(1 2 3 :DEFAULT); say "YEAH!" if foobar();
In reply to Re^5: How to pass an argument to a Module?
by tobyink
in thread How to pass an argument to a Module?
by mascip
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |