We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80deb58 commit 2e7d8deCopy full SHA for 2e7d8de
doc/Language/modules.pod
@@ -283,6 +283,23 @@ passing C<:DEFAULT> to C<use> along with your positional parameters.
283
shy(); #FAIL - won't be imported
284
=end code
285
286
+C<EXPORT> can take arguments, given it was provided with a signature. Type
287
+captures are supported.
288
+
289
+ # lib/MyModule.pm
290
291
+ sub EXPORT(Int $i = 42) {
292
+ {
293
+ 'foo' => sub () { $i }
294
+ }
295
296
297
+ # main.pl
298
299
+ use MyModule 666;
300
301
+ foo(); # 666
302
303
=head1 Distributing Modules
304
305
If you've written a Perl 6 module and would like to share it with the
0 commit comments