pod6

Access POD from another Perl 6 file

余生长醉 提交于 2019-12-30 18:31:40
问题 The Perl 6 POD documentation has a section on accessing the current file's POD document by using $=pod . There is no information on accessing another file's POD document. How can I access another file's POD structure, without altering the current file's $=pod ? 回答1: You can now do that with Pod::Load. From the README in the examples directory perl6 -e 'use Pod::Load; .perl.say for load("pod-load-clean.pod6")' Please note that the Pod6 file has to be "clean", that is, not use any external

Access POD from another Perl 6 file

妖精的绣舞 提交于 2019-12-01 17:23:44
The Perl 6 POD documentation has a section on accessing the current file's POD document by using $=pod . There is no information on accessing another file's POD document. How can I access another file's POD structure, without altering the current file's $=pod ? You can now do that with Pod::Load . From the README in the examples directory perl6 -e 'use Pod::Load; .perl.say for load("pod-load-clean.pod6")' Please note that the Pod6 file has to be "clean", that is, not use any external module that is not generally available or it might fail. Perhaps someone knows a clean way to do this, in which

Obtaining the Pod of a module without explicitly exporting it

℡╲_俬逩灬. 提交于 2019-12-01 15:58:04
问题 The documentation in Perl 6 programs, using the Pod 6 DSL, are actually parsed as part of the code; this makes that documentation available, inside the program, as the $=pod variable. However, I'd like to have access to that variable in order to process it from, say, tests. In this example I wrote for the Perl 6 Advent Calendar it's simply exported as a class (grammar, in this case) variable: our $pod = $=pod[0]; I can then use it this way: use Data::Dump; use MONKEY-SEE-NO-EVAL; sub MAIN(