The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MyApp - JSON-RPC server sample class

DESCRIPTION

This module is a smple code (for Perl 5.6 or later). Please check the source.

PROCEDURES

echo

Takes a scalar and returns it as is.

now

Returns the current time.

sum

Takes two numbers and returns the total.

  sum : Number(a:num, b:num)

The two numbers are automatically set into 'a' and 'b'.

sum2

Takes two numbers and returns the total.

  sum2 : Public

This routine is a sample for both JSONRPC 1.1 and 1.0

sum3

Same as sum3 but its format is difference.

  sum3 : String(a, b)
sum4

This is a private procedure, so client can't call this.

  sum4 : Private

This is a reserved procedure returns a Service Description object.

See to http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html#ServiceDescription.

_allowable_procedure

If you change the name into allowable_procedure, clients are able to call echo and sum only.

allowable_procedure is a special name and the method returns a hash reference contains procedure names and its code reference.

  sub allowable_procedure {
      return {
          echo => \&echo,
          sum  => \&sum,
      };
  }

AUTHOR

Makamaka Hannyaharamitu, <makamaka[at]cpan.org>

COPYRIGHT AND LICENSE

Copyright 2008 by Makamaka Hannyaharamitu

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

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 133:

=back doesn't take any parameters, but you said =back MyApp::system::describe

Around line 139:

'=item' outside of any '=over'

Around line 157:

You forgot a '=back' before '=head1'