<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Perinci::Access::Perl - Access Perl module, functions, variables through
    Riap

VERSION
    This document describes version 0.72 of Perinci::Access::Perl (from Perl
    distribution Perinci-Access-Perl), released on 2014-10-23.

SYNOPSIS
    First write your code and add Rinci metadata to them:

     package MyMod::MySubMod;

     our %SPEC;

     $SPEC{':package'} = {
         v =&gt; 1.1,
         summary =&gt; 'This package is blah blah',
     };

     $SPEC{'$var1'} = {
         v =&gt; 1.1,
         summary =&gt; 'This variable is blah blah',
     };
     our $var1;

     $SPEC{func1} = {
         v =&gt; 1.1,
         summary =&gt; 'This function does blah blah',
         args =&gt; {
             a =&gt; { schema =&gt; 'int', req =&gt; 1 },
             b =&gt; { schema =&gt; 'int' },
         },
     };
     sub func1 {
         ...
     }
     1;

    then access them through Riap:

     use Perinci::Access::Perl;
     my $pa = Perinci::Access::Perl-&gt;new;

     # call function
     $res = $pa-&gt;request(call =&gt; '/MyMod/MySubMod/func1', {args=&gt;{a=&gt;1, b=&gt;2}});

     # get variables
     $res = $pa-&gt;request(get =&gt; '/MyMod/MySubMod/$var1');

DESCRIPTION
    This class allows you to access Perl modules, functions, and variables
    through Riap. Only those which have Rinci metadata are accessible. The
    metadata is put in %SPEC package variables, with function names as keys,
    or ":package" for package metadata, or $NAME for variables. Functions
    will be wrapped before executed (unless you pass "wrap =&gt; 0" to the
    constructor).

    You should probably use this through Perinci::Access.

FUNCTIONS
  new(%opts) =&gt; OBJ
    Constructor. For a list of options, see superclass
    Perinci::Access::Schemeless except for "package_prefix" which are not
    recognized by this class.

  $pa-&gt;request($action, $uri, \%extras) =&gt; RESP
  $pa-&gt;parse_url($url) =&gt; HASH
FAQ
  Why %SPEC (instead of %META, %METADATA, %RINCI, etc)?
    The name was first chosen during Sub::Spec era (see BackPAN) in 2011, it
    stuck. By that time I already had had a lot of code written using %SPEC.

  Why wrap?
    The wrapping process accomplishes several things, among others: checking
    of metadata, normalization of schemas in metadata, also argument
    validation and exception trapping in function.

    The function wrapping introduces a small overhead when performing a sub
    call (typically around several to tens of microseconds on an Intel Core
    i5 1.7GHz notebook). This is usually smaller than the overhead of
    Perinci::Access::Perl itself (typically in the range of 100
    microseconds). But if you are concerned about the wrapping overhead, see
    the "wrap =&gt; 0" option.

SEE ALSO
    Perinci::Access::Schemeless

    Perinci::Access

    Riap

HOMEPAGE
    Please visit the project's homepage at
    &lt;https://metacpan.org/release/Perinci-Access-Perl&gt;.

SOURCE
    Source repository is at
    &lt;https://github.com/perlancar/perl-Perinci-Access-Perl&gt;.

BUGS
    Please report any bugs or feature requests on the bugtracker website
    &lt;https://rt.cpan.org/Public/Dist/Display.html?Name=Perinci-Access-Perl&gt;

    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 &lt;perlancar@cpan.org&gt;

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.

</pre></body></html>