perlancar > Perinci-Gen-ForModule > Perinci::Gen::ForModule

Download:
Perinci-Gen-ForModule-0.04.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Perinci::Gen::ForModule - Generate metadata for a module

VERSION ^

This document describes version 0.04 of Perinci::Gen::ForModule (from Perl distribution Perinci-Gen-ForModule), released on 2014-12-05.

SYNOPSIS ^

In Foo/Bar.pm:

 package Foo::Bar;
 sub sub1 { ... }
 sub sub2 { ... }
 1;

In another script:

 use Perinci::Gen::FromModule qw(gen_meta_for_module);
 gen_meta_for_module(module=>'Foo::Bar');

Now Foo::Bar has metadata stored in %Foo::Bar::SPEC.

FUNCTIONS ^

gen_meta_for_module(%args) -> [status, msg, result, meta]

Generate metadata for a module.

This function can be used to automatically generate Rinci metadata for a "traditional" Perl module which do not have any. Currently, only a plain and generic package and function metadata are generated.

The resulting metadata will be put in %<PACKAGE>::SPEC. Functions that already have metadata in the %SPEC will be skipped. The metadata will have result_naked property set to true, args_as set to array, and args set to {args = ["any" => {schema=>'any', pos=>0, greedy=>1}]}>. In the future, function's arguments (and other properties) will be parsed from POD (and other indicators).

Arguments ('*' denotes required arguments):

Return value:

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

 (any)

SEE ALSO ^

Perinci, Rinci

HOMEPAGE ^

Please visit the project's homepage at https://metacpan.org/release/Perinci-Gen-ForModule.

SOURCE ^

Source repository is at https://github.com/perlancar/perl-Perinci-Gen-ForModule.

BUGS ^

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-Gen-ForModule

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR ^

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2014 by perlancar@cpan.org.

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

syntax highlighting: