Marcel Grünauer


Pod::Generated - Generate POD documentation during "make" time


    use Pod::Generated 'add_doc';

    my $pkg = __PACKAGE__;
    add_doc($pkg, CODE   => 'new',   purpose => 'A constructor.');
    add_doc($pkg, SCALAR => 'count', purpose => 'Number of flurbles.');


This module provides support for generating POD documentation for your modules during make time. It does not itself generate the documentation - the combination of Module::Install::Template and Template::Plugin::PodGenerated does that.

Also see Pod::Generated::Attributes.

Modules that generate methods - such as Class::Accessor - might want to use this module. Class::Accessor::Complex, Class::Accessor::Constructor and Class::Accessor::FactoryTyped do support generated documentation, or will do so shortly.

This modules exports two functions on request:

    add_doc($pkg, $glob_type, $symbol_name, $doc_type, $doc);

Adds documentation. Takes as arguments the package for which to add documentation, a glob type (CODE, SCALAR, ARRAY, HASH), the symbol name for which to add documentation (i.e., the subroutine name or variable name), the documentation type (e.g., purpose, example) and the documentation string.

The symbol name alone is insufficient to determine what is being documented - does new refer to the subroutine new() or any of the variables $new, C@new> or %new? Therefore you also need to pass the glob type.

The documentation type is freely definable, but the code that actually generates the documentation (for example, Template::Plugin::PodGenerated) needs to understand these documentation types.

Documentation is stored in a nested hash.


Returns the documentation hash. This can be used by modules that actually generate the documentation to inspect which documentation has been defined.


If you talk about this module in blogs, on or anywhere else, please use the podgenerated tag.


No bugs have been reported.

Please report any bugs or feature requests to, or through the web interface at


See perlmodinstall for information and options on installing Perl modules.


The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit <> to find a CPAN site near you. Or see


Marcel Grünauer, <>


Copyright 2007-2009 by Marcel Grünauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.