@@ -295,27 +295,27 @@ the values are the desired values. The names should include the sigil
295
295
= begin code :skip-test
296
296
# lib/MyModule.pm
297
297
298
- class MyModule::Class { ... }
298
+ class MyModule::Class { }
299
299
300
300
sub EXPORT {
301
- {
302
- '$var' => 'one',
303
- '@array' => <one two three>,
304
- '%hash' => { one => 'two', three => 'four' } ,
305
- '&doit' => sub { ... },
306
- 'ShortName' => MyModule::Class
307
- }
301
+ %(
302
+ '$var' => 'one',
303
+ '@array' => <one two three>,
304
+ '%hash' => %( one => 'two', three => 'four' ) ,
305
+ '&doit' => sub { say 'Greetings from exported sub' },
306
+ 'ShortName' => MyModule::Class
307
+ )
308
308
}
309
309
= end code
310
310
311
311
= begin code :skip-test
312
312
# main.pl
313
313
use lib 'lib';
314
314
use MyModule;
315
- say $var;
316
- say @array;
317
- say %hash;
318
- doit();
315
+ say $var; # OUTPUT: «one»
316
+ say @array; # OUTPUT: «(one two three)»
317
+ say %hash; # OUTPUT: «{one => two, three => four}»
318
+ doit(); # OUTPUT: «Greetings from exported sub»
319
319
say ShortName.new; # OUTPUT: «MyModule::Class.new»
320
320
= end code
321
321
@@ -350,7 +350,8 @@ passing C<:DEFAULT> to C<use> along with your positional parameters.
350
350
# main.pl
351
351
use lib 'lib';
352
352
use MyModule 'foo';
353
- say foo.new(); # MyModule::Class.new
353
+ say foo.new(); # OUTPUT: «MyModule::Class.new»
354
+
354
355
always(); # OK - is imported
355
356
shy(); # FAIL - won't be imported
356
357
= end code
@@ -371,7 +372,7 @@ L<Cool>s.
371
372
372
373
= begin code :skip-test
373
374
use MakeQuestionable Cool;
374
- say 0?, 1?, {}?, { a => "b" }? ; # OUTPUT: «False True False True»
375
+ say ( 0?, 1?, {}?, %( a => "b" )? ).join(' ') ; # OUTPUT: «False True False True»
375
376
= end code
376
377
377
378
= head2 Introspection
0 commit comments