Reputation: 1807
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
?
Upvotes: 7
Views: 254
Reputation: 903
I have created a filesystem-agnostic solution in Module::Pod (soon to be published) at [email protected]:dmaestro/Module-Pod.git
use Module::Pod;
# Get all Pod::Block::* objects in the module, from its own $=pod
my @pod = pod-from-module(<My::Module>);
Pros:
use
-ing the module for other purposes in your codeCons:
Intended for use in Pod6-checking tests, etc.
Upvotes: 2
Reputation: 23517
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.
Upvotes: 4