Unix and Linux Discussions Tagged with bar |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
5,512 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,377 |
Shell Programming and Scripting |
|
|
|
1 |
1,795 |
What is on Your Mind? |
|
|
|
3 |
5,794 |
Shell Programming and Scripting |
|
|
|
0 |
5,331 |
Programming |
|
|
|
0 |
4,273 |
Windows & DOS: Issues & Discussions |
|
|
|
2 |
7,783 |
Shell Programming and Scripting |
|
|
|
0 |
1,278 |
UNIX and Linux RSS News |
|
|
|
0 |
2,237 |
OS X Support RSS |
|
|
|
0 |
951 |
Software Releases - RSS News |
|
|
|
0 |
864 |
Software Releases - RSS News |
|
|
|
0 |
1,484 |
UNIX and Linux RSS News |
|
|
|
1 |
4,929 |
Shell Programming and Scripting |
|
|
|
0 |
1,257 |
Software Releases - RSS News |
|
|
|
0 |
1,433 |
UNIX and Linux RSS News |
|
|
|
1 |
16,056 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
982 |
UNIX and Linux RSS News |
|
|
|
0 |
788 |
Software Releases - RSS News |
|
|
|
0 |
2,062 |
UNIX and Linux RSS News |
|
|
|
1 |
4,516 |
Linux |
|
|
|
0 |
997 |
Software Releases - RSS News |
|
|
|
3 |
5,981 |
Shell Programming and Scripting |
|
|
|
5 |
3,384 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,723 |
UNIX for Advanced & Expert Users |
|
|
|
5 |
3,561 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
4,615 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
15,753 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
6,959 |
UNIX for Dummies Questions & Answers |
Mojo::JSON::Pointer(3pm) User Contributed Perl Documentation Mojo::JSON::Pointer(3pm)
NAME
Mojo::JSON::Pointer - JSON Pointers
SYNOPSIS
use Mojo::JSON::Pointer;
my $p = Mojo::JSON::Pointer->new;
say $p->get({foo => [23, 'bar']}, '/foo/1');
say 'Contains "/foo".' if $p->contains({foo => [23, 'bar']}, '/foo');
DESCRIPTION
Mojo::JSON::Pointer implements JSON Pointers as described in http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer
<http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer>.
METHODS
"contains"
my $success = $p->contains($data, '/foo/1');
Check if data structure contains a value that can be identified with the given JSON Pointer.
# True
$p->contains({foo => 'bar', baz => [4, 5, 6]}, '/foo');
$p->contains({foo => 'bar', baz => [4, 5, 6]}, '/baz/2');
# False
$p->contains({foo => 'bar', baz => [4, 5, 6]}, '/bar');
$p->contains({foo => 'bar', baz => [4, 5, 6]}, '/baz/9');
"get"
my $value = $p->get($data, '/foo/bar');
Extract value identified by the given JSON Pointer.
# "bar"
$p->get({foo => 'bar', baz => [4, 5, 6]}, '/foo');
# "4"
$p->get({foo => 'bar', baz => [4, 5, 6]}, '/baz/0');
# "6"
$p->get({foo => 'bar', baz => [4, 5, 6]}, '/baz/2');
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::JSON::Pointer(3pm)