Help language development. Donate to The Perl Foundation

Pod::Load cpan:JMERELO last updated on 2018-12-18


Build Status


Pod::Load - Loads and compiles the Pod documentation of an external file


use Pod::Load;

# Read a file handle.
my $pod = load("file-with.pod6".IO);
say $pod.perl; # Process it as a Pod

# Or use simply the file name
my @pod = load("file-with.pod6");
say .perl for @pod;

my $string-with-pod = q:to/EOH/;

This ordinary paragraph introduces a code block:


say load( $string-with-pod ).perl;

You can also reconfigure the global variables. However, if you change one you'll have to change the whole thing. In the future, I might come up with a better way of doing this...

$Pod::Load::tmp-dir= "/tmp/my-precomp-dir/"; $Pod::Load::precomp-store = => $Pod::Load::tmp-dir.IO); $Pod::Load::precomp = => $Pod::Load::precomp-store);


Pod::Load is a module with a simple task: obtain the documentation of an external file in a standard, straighworward way. Its mechanism is inspired by Pod::To::BigPage, from where the code to use the cache is taken from.


JJ Merelo


Copyright 2018 JJ Merelo

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

multi sub load

multi sub load(
    Str $string
) returns Mu

Loads a string, returns a Pod.

multi sub load

multi sub load(
    Str $file where { ... }
) returns Mu

If it's an actual filename, loads a file and returns the pod

multi sub load

multi sub load(
    IO::Path $io
) returns Mu

Loads a IO::Path, returns a Pod. Taken from pod2onepage