Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Perl 6 implementation of JSONPath.

branch: master

make tests pass again

this fixes fallout from the ? quantifier match object changes
latest commit ecd8a5c035
Moritz Lenz moritz authored
Octocat-spinner-32 lib make tests pass again June 02, 2013
Octocat-spinner-32 t [t/01basic.t] fix test count October 20, 2012
Octocat-spinner-32 LICENSE.txt [LICENSE.txt] added October 20, 2012
Octocat-spinner-32 [] change to public source-url October 26, 2012
Octocat-spinner-32 [] added one more case October 20, 2012

JSON::Path gives you the power to deeply index data structures (containing arrays and hashes) with path expressions.

# index into { kitchen => { drawers => [ { fork => '!' } ] } }
my $path ='$.kitchen.drawers[0].fork');

JsonPath is like XPath but adapted for JSON. It simplifies and adapts the path expressions a bit, to better fit the data structures stored by JSON. You can read more about the syntax by following that link there, but here's a summary:

$           root node
.key        index hash key
.*          index all hash keys
['key']     index hash key
[2]         index array element
[0,1]       index array slice
[4:5]       index array range
[:5]        index from the beginning
[-3:]       index to the end
[*]         index all array elements
[?(expr)]   filter on (Perl 6) expression
..key       search all descendants for hash key

The module is functionally a port of CPAN's JSON::Path, even though the internals look quite different.

Something went wrong with that request. Please try again.