JSON::...cedure(3pm)
πΈ NAME πΈ
okay so bestie, welcome to the JSON::...cedure(3pm) manual page π
this one is all about JSON::RPC::Legacy::Procedure β literally the JSON-RPC Service attributes module, no cap.
β¨ SYNOPSIS β¨
bestie, hereβs the whole vibe in code:
package MyApp;
use base ('JSON::RPC::Legacy::Procedure');
sub sum : Public {
my ($s, @arg) = @_;
return $arg[0] + $arg[1];
}
# or
sub sum : Public(a, b) {
my ($s, $obj) = @_;
return $obj->{a} + $obj->{b};
}
# or
sub sum : Number(a:num, b:num) {
my ($s, $obj) = @_;
return $obj->{a} + $obj->{b};
}
# private method can't be called by clients
sub _foobar : Private {
# ...
}
slay, moving on π«Ά
π¦ DESCRIPTION π¦
Using this module, you can write a subroutine with a special attribute. iconic behavior, honestly β¨
Currently, in the attributes below, only Public and Private are available. The others are same as Public. Important little detail, bestie π
Publicβ means that a client can call this procedure.Privateβ means that a client canβt call this procedure.Arrβ means that its return values is an array object.Objβ means that its return values is a member object.Bitβ means that a return values is a "true" or "false".Boolβ means that a return values is a "true" or "false".Numβ means that its return values is a number.Strβ means that its return values is a string.Nilβ means that its return values is a "null".Noneβ means that its return values is a "null".
the way these attributes just sit there being all useful? obsessed π
π TODO π
future vibes, not done yet:
- Auto Service Description
- Type check
itβs giving βweβll get to itβ energy π but those are literally the listed TODOs.
π SEE ALSO π
<http://json-rpc.org/wd/JSON-RPC-1-1-WD-20060807.html>β the spec link, iykyk β
π AUTHOR π
Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
periodt π
π COPYRIGHT AND LICENSE π
Copyright 2007 by Makamaka Hannyaharamitu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
cute little sign-off bestie: source is User Contributed Perl Documentation, version is perl v5.42.0, and the date is 2015-08-27 π§π
π¦ where this page comes from
- opensuse-leap 16.0: perl-JSON-RPC 1.06-bp160.1.11 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms