<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -28,33 +28,15 @@ using the symbol '@' for the current object. Filter expressions are supported vi
 
 	$.store.book[?(@.price &lt; 10)].title
 
-Here is a complete overview and a side by side comparison of the JSONPath syntax elements with its XPath counterparts.
-
-&lt;table&gt;&lt;tr class=&quot;evn&quot;&gt;&lt;td&gt; &lt;strong&gt;XPath&lt;/strong&gt; &lt;/td&gt;&lt;td&gt; &lt;strong&gt;JSONPath&lt;/strong&gt; &lt;/td&gt;&lt;td&gt; &lt;strong&gt;Result&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;/store/book/author&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$.store.book[*].author&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the authors of all books in the store &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//author&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..author&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;all authors &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;/store/*&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$.store.*&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;all things in store, which are some books and a red bicycle. &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;/store//price&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$.store..price&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the price of everything in the store. &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[3]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[2]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the third book &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[last()]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[(@.length-1)]&lt;/code&gt;&lt;br&gt;
-&lt;code&gt;$..book[-1:]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the last book in order. &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[position()&amp;lt;3]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[0,1]&lt;/code&gt;&lt;br&gt;
-&lt;code&gt;$..book[:2]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the first two books &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[isbn]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[?(@.isbn)]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;filter all books with isbn number &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[price&amp;lt;10]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[?(@.price&amp;lt;10)]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;filter all books cheapier than 10 &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//*&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..*&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;all Elements in XML document. All members of JSON structure. &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;???&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$.store.!&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;all the keys in the store hash (bicycle, book)&lt;/td&gt;&lt;/tr&gt;
-&lt;/table&gt;
-
-XPath has a lot more to offer (Location pathes in not abbreviated syntax, operators and functions) than listed here. Moreover there is a remarkable difference how the subscript operator works in Xpath and JSONPath.
+XPath has a lot more to offer (Location paths in not abbreviated syntax, operators and functions) than listed here. Moreover there is a remarkable difference how the subscript operator works in Xpath and JSONPath.
 
     * Square brackets in XPath expressions always operate on the node set resulting from the previous path fragment. Indices always start by 1.
     * With JSONPath square brackets operate on the object or array addressed by the previous path fragment. Indices always start by 0. 
 
  
-[edit] [comment] [remove] |2007-08-18| e3 # JSONPath examples
+# JSONPath examples
 
-Let's practice JSONPath expressions by some more examples. We start with a simple JSON structure built after an XML example representing a bookstore (original XML file).
+Let's practice JSONPath expressions by some more examples. We start with a simple JSON structure built after an XML example representing a bookstore.
 
 	{ &quot;store&quot;: {
 		&quot;book&quot;: [ 
@@ -88,22 +70,27 @@ Let's practice JSONPath expressions by some more examples. We start with a simpl
 	  }
 	}
 
+Here are examples of all the types of JSONPath expressions you could perform on this and what you should expect to see as a result. We've also included the comparable XPath expressions.
+
+    XPath               JSONPath                Result
+    /store/book/author   $.store.book[*].author  the authors of all books in the store
+    //author             $..author               all authors
+    /store/*             $.store.*               all things in store, which are some books and a red bicycle.
+    /store//price        $.store..price          the price of everything in the store.
+    //book[3]            $..book[2]              the third book
+    //book[last()]       $..book[(@.length-1)]
+    //book[position()&lt;3] $..book[-1:]            the last book in order.
+                         $..book[0,1]
+                         $..book[:2]             the first two books
+    //book[isbn]         $..book[?(@.isbn)]      filter all books with isbn number
+    //book[price&lt;10]     $..book[?(@.price&lt;10)]  filter all books cheapier than 10
+    //*                  $..*                    all Elements in XML document. All members of JSON structure.
+    ???                  $.store.!               all the keys in the store hash (bicycle, book)
+                         $..book[?(@.ratings&gt;&lt;'good')]
+                                                all the books with a ratings element that contains the word &quot;good&quot;
+                                                This could be a key in a hash, an item in an array,
+                                                or a substring of a string.
 
-&lt;table&gt;&lt;tbody&gt;&lt;tr class=&quot;evn&quot;&gt;&lt;td&gt; &lt;strong&gt;XPath&lt;/strong&gt; &lt;/td&gt;&lt;td&gt; &lt;strong&gt;JSONPath&lt;/strong&gt; &lt;/td&gt;&lt;td&gt; &lt;strong&gt;Result&lt;/strong&gt; &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;/store/book/author&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$.store.book[*].author&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the authors of all books in the store &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//author&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..author&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;all authors &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;/store/*&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$.store.*&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;all things in store, which are some books and a red bicycle. &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;/store//price&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$.store..price&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the price of everything in the store. &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[3]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[2]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the third book &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[last()]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[(@.length-1)]&lt;/code&gt;&lt;br&gt;
-&lt;code&gt;$..book[-1:]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the last book in order. &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[position()&amp;lt;3]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[0,1]&lt;/code&gt;&lt;br&gt;
-&lt;code&gt;$..book[:2]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;the first two books &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[isbn]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[?(@.isbn)]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;filter all books with isbn number &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//book[price&amp;lt;10]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..book[?(@.price&amp;lt;10)]&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;filter all books cheapier than 10 &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;evn&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;//*&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$..*&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;all Elements in XML document. All members of JSON structure. &lt;/td&gt;&lt;/tr&gt;
-&lt;tr class=&quot;odd&quot;&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;???&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;&lt;code&gt;$.store.!&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;lft&quot;&gt;all the keys in the store hash (bicycle, book)&lt;/td&gt;&lt;/tr&gt;
-&lt;/tbody&gt;&lt;/table&gt;
 
 ## JSONPath implementation
 </diff>
      <filename>README.mkdn</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,7 @@ package JSONPath;
 use strict;
 use lib '../../lib';
 use JSON;
+use Scalar::Util qw(looks_like_number);
 
 
 sub new(){
@@ -59,7 +60,7 @@ sub run(){
 	$self-&gt;{'obj'} = undef;
 	my ($obj, $expr, $arg) = @_;
 	#my $self-&gt;{'obj'} = $obj;
-	##$self-&gt;logit( &quot;arg: $arg&quot;);
+	#$self-&gt;logit( &quot;arg: $arg&quot;);
 	if ($arg &amp;&amp; $arg-&gt;{'result_type'}){
 		my $result_type = $arg-&gt;{'result_type'};
 		if ($result_type eq 'PATH' | $result_type eq 'VALUE'){
@@ -143,7 +144,7 @@ sub store(){
 }
 
 sub trace(){
-	##$self-&gt;logit( &quot;raw trace args: @_&quot;);
+	#$self-&gt;logit( &quot;raw trace args: @_&quot;);
 	my $self = shift;
 	my ($expr, $obj, $path) = @_;
 	#$self-&gt;logit( &quot;in trace. $expr /// $obj /// $path&quot;);
@@ -151,12 +152,14 @@ sub trace(){
 		my @x = split(/;/, $expr);
 		my $loc = shift(@x);
 		my $x_string = join(';', @x);
+		#$self-&gt;logit(&quot;trace... expr: $expr x_string: $x_string&quot;);
 		my $ref_type = ref $obj;
 		my $reserved_loc = 0;
 		if (exists $self-&gt;{'reserved_locs'}-&gt;{$loc}){
 			$reserved_loc = 1;
 		}
 		
+		#$self-&gt;logit(&quot;loc: $loc  // $reserved_loc // $ref_type&quot;);
 		
 		if (! $reserved_loc and  $ref_type eq 'HASH' and ($obj and exists $obj-&gt;{$loc}) ){ 
 			#$self-&gt;logit( &quot;tracing loc($loc) obj (hash)?&quot;);
@@ -183,14 +186,17 @@ sub trace(){
 			#$self-&gt;logit( &quot;tracing loc /^\(.*?\)\$/&quot;);
 			my $path_end = $path;
 			$path_end =~ s/.*;(.).*?$/$1/;
+			#WTF is eobjuate?!
 			$self-&gt;trace($self-&gt;eobjuate($loc, $obj, $path_end . ';' . $x_string, $obj, $path));
 		} elsif ($loc =~ /^\?\(.*?\)$/){
 			#$self-&gt;logit( &quot;tracing loc /^\?\(.*?\)\$/&quot;);
 			$self-&gt;walk($loc, $x_string, $obj, $path, \&amp;_callback_05);
 			#$self-&gt;logit( &quot;after walk w/ 05&quot;);
 		} elsif ($loc =~ /^(-?[0-9]*):(-?[0-9]*):?([0-9]*)$/){
-			#$self-&gt;logit( &quot;tracing loc for slice&quot;);
+			#$self-&gt;logit( &quot;tracing loc ($loc) for slice&quot;);
 			$self-&gt;slice($loc, $x_string, $obj, $path);
+		} elsif (! $loc and $ref_type eq 'ARRAY'){
+			$self-&gt;store($path, $obj);
 		}
 	} else {
 		#$self-&gt;logit( &quot;trace no expr. will store $obj&quot;);
@@ -227,11 +233,13 @@ sub walk (){
 
 sub slice(){
 	my $self = shift;
-	#$self-&gt;logit( &quot;in slice&quot;);
 	my ($loc, $expr, $obj, $path) = @_;
 	$loc =~ s/^(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)$/$1:$2:$3/;
-	my @s = split ($loc);
-
+	# $3 would be if you wanted to specify the steps between the start and end.
+	
+	
+	my @s = split (/:|,/,  $loc);
+	
 	my $len = 0;
 	if (ref $obj eq 'HASH'){
 		$len = $#{keys %{$obj}};
@@ -239,11 +247,22 @@ sub slice(){
 		$len = $#{$obj};
 	}
 	my $start = $s[0] ? $s[0] : 0;
-	my $end = $s[1] ? $s[1] : $len; 
+	my $end = undef;
+	if ($loc !~ m/^:(\d+):?$/){
+		$end = $s[1] ? $s[1] : $len; 
+	} else {
+		$end = int($s[1]) -1;
+	}
+	
 	my $step = $s[2] ? $s[2] : 1;
-	$start = $start &lt; 0 ? ($start + $len &gt; 0 ? $start + $len : 0) : ($len &gt; $start ? $start : $len); 
+	#$start = $start &lt; 0 ? ($start + $len &gt; 0 ? $start + $len : 0) : ($len &gt; $start ? $start : $len);
+	if ($start &lt; 0){
+		$start =  $len &gt; 0 ? $start + $len +1: 0 ; 
+		#the +1 is so that -1 gets us the last entry, -2 gets us the last two, etc...
+	}
 	$end = $end &lt; 0 ? ($end + $len &gt; 0 ? $end + $len : 0) : ($len &gt; $end ? $end : $len); 
-	for (my $x = $start; $x &lt; $end-1; $x += $step){
+	#$self-&gt;logit(&quot;start: $start end: $end step: $step&quot;);
+	for (my $x = $start; $x &lt;= $end; $x += $step){
 		$self-&gt;trace(&quot;$x;$expr&quot;, $obj, $path);
 	}
 }
@@ -265,6 +284,7 @@ sub evalx(){
 		#$self-&gt;logit( &quot;existence test &quot;);
 		$loc =~ s/@\.([a-zA-Z0-9_-]*)$/exists \$obj-&gt;{'$1'}/;
 	} else { # it's a comparis on some sort?
+		my $obj_type = ref($obj);
 		$loc =~ s/@\.([a-zA-Z0-9_-]*)(.*)/\$obj-&gt;{'$1'}$2/;
 		$loc =~ s/(?&lt;!=)(=)(?!=)/==/; #convert single equals to double
 		if ($loc =~ m/\s*(!|=)=['&quot;](.*?)['&quot;]/){
@@ -273,9 +293,8 @@ sub evalx(){
 			my $string_match = 0;
 			if ($loc =~ m/ (eq|ne) /){ #dunno if those replacements happened...
 				$string_match =1;
-			}	
+			}
 			#$self-&gt;logit( &quot;comparison test of  $1 and $2 ::loc:: $loc&quot;);
-			my $obj_type = ref($obj);
 			if ($obj_type ne 'HASH' and $obj_type ne 'ARRAY' and $obj){
 				if (! $string_match){
 					$loc =~s/\$obj-&gt;{(.*?)}(.*)/$obj $2/;
@@ -283,7 +302,60 @@ sub evalx(){
 					$loc =~s/\$obj-&gt;{(.*?)}(.*)/&quot;$obj&quot; $2/;
 				}
 				return ($obj and $loc and eval($loc)) ? 1 : 0;
+			} 
+		} elsif ($loc =~ m/&gt;&lt;/){
+			my $query_item = $loc;
+			$query_item =~ s/.*&gt;&lt;\s*['&quot;]?([\w\.]*)['&quot;]?\s*/$1/;
+			#$self-&gt;logit(&quot;includes test: $query_item :: $loc ::&quot;);
+			if (($obj_type eq 'HASH' or $obj_type eq 'ARRAY')){
+				#$self-&gt;logit(&quot;hash or array&quot;);
+				if ($obj_type eq 'HASH'){
+					#something like &quot;$..book[?(@.ratings&gt;&lt;'good')]&quot;
+					#obj is book
+					my $eval_string = $loc;
+					my $sub_obj = undef;
+					$eval_string =~ s/(.*?)&gt;&lt;.*/$1/;
+					#$eval_string =~ s/(.*?)&gt;&lt;.*/\$sub_obj_type = ref $1\-&gt;{'$query_item'}/;
+					#$self-&gt;logit(&quot;eval_string: $eval_string&quot;);
+					#set the sub_obj_type
+					eval('$sub_obj = ' . $eval_string);
+					my $sub_obj_type =ref $sub_obj;
+					#$self-&gt;logit(&quot;sub_obj_type: $sub_obj_type&quot;);
+					if ($sub_obj){
+						if ($sub_obj_type eq 'ARRAY'){
+							foreach my $item (@{$sub_obj}){
+								if (looks_like_number($item)){
+									return 1 if $item == $query_item;
+								}else {
+									return 1 if $item eq $query_item;
+								}
+							}
+							return 0;
+						} elsif ($sub_obj_type eq 'HASH'){
+							return exists ($sub_obj-&gt;{$query_item}) ? 1 : 0;
+						}  
+					} else {
+						#$self-&gt;logit(&quot;no sub_obj&quot;);
+					}
+				}
+			} else {
+				#$self-&gt;logit(&quot; in array item evalling&quot;);
+				my $returnable = 0;
+				if (! looks_like_number($obj)){
+					#Does the string include the string they've provided?
+					#return ($obj eq $query_item or $obj =~ m/.*?$query_item.*?/) ? 1 : 0;
+					$returnable =  ($obj eq $query_item or $obj =~ m/.*?$query_item.*?/) ? 1 : 0;
+				} else {
+					#return $obj == $query_item;
+					$returnable = ($obj == $query_item) ? 1 : 0;
+				}
+				#not the best use of the &gt;&lt; operator. we've been drilled down to
+				#
+				#$self-&gt;logit(&quot;returning $returnable&quot;);
+				return $returnable;
 			}
+		} else {
+			#$self-&gt;logit(&quot;loc not equality or includes test: $loc&quot;);
 		}
 	}
 	#print STDERR &quot;loc: $loc\n&quot;;
@@ -319,7 +391,7 @@ sub _callback_04(){
 	#$self-&gt;logit( &quot; in 04. expr = $expr&quot;);
 	if (ref $obj eq 'HASH'){
 		if (ref($obj-&gt;{$key}) eq 'HASH' ){
-			##$self-&gt;logit( &quot;Passing this to trace: ..;$expr, &quot; . $obj-&gt;{$key} . &quot;, $path;$key\n&quot;;
+			#$self-&gt;logit( &quot;Passing this to trace: ..;$expr, &quot; . $obj-&gt;{$key} . &quot;, $path;$key\n&quot;;
 			$self-&gt;trace('..;'.$expr, $obj-&gt;{$key}, $path . ';' . $key);
 		} elsif (ref($obj-&gt;{$key})) { #array
 			#print STDERR &quot;--- \$obj-&gt;{$key} wasn't a hash. it was a &quot; . (ref $obj-&gt;{$key}) . &quot;\n&quot;;
@@ -349,6 +421,7 @@ sub _callback_05(){
 	}
 	#$self-&gt;logit( &quot;eval_result: $eval_result&quot;); 
 	if ($eval_result){
+		#$self-&gt;logit(&quot;IT EVALLED! tracing..&quot;);
 		$self-&gt;trace(&quot;$key;$expr&quot;, $obj, $path);
 	}
 	#$self-&gt;logit( &quot;leaving 05&quot;);</diff>
      <filename>lib/JSONPath.pm</filename>
    </modified>
    <modified>
      <diff>@@ -5,36 +5,52 @@ use JSON;
 use JSONPath;
 use base qw(Test::Unit::TestCase);
 
-my %test_structure =(&quot;store&quot; =&gt; {
-    &quot;book&quot; =&gt; [ 
-      { &quot;category&quot; =&gt; &quot;reference&quot;,
-        &quot;author&quot; =&gt; &quot;Nigel Rees&quot;,
-        &quot;title&quot; =&gt; &quot;Sayings of the Century&quot;,
-        &quot;price&quot; =&gt; 8.95
-      },
-      { &quot;category&quot; =&gt; &quot;fiction&quot;,
-        &quot;author&quot; =&gt; &quot;Evelyn Waugh&quot;,
-        &quot;title&quot; =&gt; &quot;Sword of Honour&quot;,
-        &quot;price&quot; =&gt; 12.99
-      },
-      { &quot;category&quot; =&gt; &quot;fiction&quot;,
-        &quot;author&quot; =&gt; &quot;Herman Melville&quot;,
-        &quot;title&quot; =&gt; &quot;Moby Dick&quot;,
-        &quot;isbn&quot; =&gt; &quot;0-553-21311-3&quot;,
-        &quot;price&quot; =&gt; 8.99
-      },
-      { &quot;category&quot; =&gt; &quot;fiction&quot;,
-        &quot;author&quot; =&gt; &quot;J. R. R. Tolkien&quot;,
-        &quot;title&quot; =&gt; &quot;The Lord of the Rings&quot;,
-        &quot;isbn&quot; =&gt; &quot;0-395-19395-8&quot;,
-        &quot;price&quot; =&gt; 22.99
-      }
-    ] ,
-    &quot;bicycle&quot; =&gt; {
-     &quot;color&quot; =&gt; &quot;red&quot;,
-     &quot;price&quot; =&gt; 19.95
-    }
-  }
+my %test_structure =(
+	&quot;store&quot;=&gt; {
+		&quot;book&quot;=&gt; [ 
+			{
+				&quot;category&quot;=&gt; &quot;reference&quot;,
+				&quot;author&quot;=&gt; &quot;Nigel Rees&quot;,
+				&quot;title&quot;=&gt; &quot;Sayings of the Century&quot;,
+				&quot;price&quot;=&gt; 8.95,
+				&quot;ratings&quot;=&gt; [
+					1,
+					3,
+					2,
+					10
+				]
+			},
+			{ 
+				&quot;category&quot;=&gt; &quot;fiction&quot;,
+				&quot;author&quot;=&gt; &quot;Evelyn Waugh&quot;,
+				&quot;title&quot;=&gt; &quot;Sword of Honour&quot;,
+				&quot;price&quot;=&gt; 12.99,
+				&quot;ratings&quot; =&gt; [
+						&quot;good&quot;,
+						&quot;bad&quot;,
+						&quot;lovely&quot;
+					]
+			},
+			{
+				&quot;category&quot;=&gt; &quot;fiction&quot;,
+				&quot;author&quot;=&gt; &quot;Herman Melville&quot;,
+				&quot;title&quot;=&gt; &quot;Moby Dick&quot;,
+				&quot;isbn&quot;=&gt; &quot;0-553-21311-3&quot;,
+				&quot;price&quot;=&gt; 8.99
+			},
+			{
+				&quot;category&quot;=&gt; &quot;fiction&quot;,
+				&quot;author&quot;=&gt; &quot;J. R. R. Tolkien&quot;,
+				&quot;title&quot;=&gt; &quot;The Lord of the Rings&quot;,
+				&quot;isbn&quot;=&gt; &quot;0-395-19395-8&quot;,
+				&quot;price&quot;=&gt; 22.99
+			}
+		],
+		&quot;bicycle&quot;=&gt; {
+			&quot;color&quot;=&gt; &quot;red&quot;,
+			&quot;price&quot;=&gt; 19.95
+		}
+	}
 );
 
 
@@ -137,17 +153,24 @@ sub test_array_retreival(){
 	}
 	
 	
-	$raw_result = $jp-&gt;run(\%test_structure, '$..book[0,1]'); #the price of everything
+	$raw_result = $jp-&gt;run(\%test_structure, '$..book[0,1]'); # the first two books
 	$self-&gt;assert($raw_result != 0);
 	@result = @{$raw_result};
 	$self-&gt;assert_equals(1, $#result);
 
 
-	$raw_result = $jp-&gt;run(\%test_structure, '$..book[:2]'); #the price of everything
+	$raw_result = $jp-&gt;run(\%test_structure, '$..book[:2]'); # the first two books
 	$self-&gt;assert($raw_result != 0);
 	@result = @{$raw_result};
 	$self-&gt;assert_equals(1, $#result);
 
+	$raw_result = $jp-&gt;run(\%test_structure, '$..book[-1:]'); # the last book
+	$self-&gt;assert($raw_result != 0);
+	@result = @{$raw_result};
+	$self-&gt;assert_equals(0, $#result);
+
+
+
 	$raw_result = $jp-&gt;run(\%test_structure, '$..book[?(@.isbn)]'); #the price of everything
 	$self-&gt;assert($raw_result != 0);
 	@result = @{$raw_result};
@@ -179,10 +202,10 @@ sub test_path_operations(){
 	@result = @{$raw_result};
 	$self-&gt;assert_equals(3, $#result);
 
-	$self-&gt;assert_equals(&quot;\$['store']['book'][0]['author']&quot;, $result[0]);
-	$self-&gt;assert_equals(&quot;\$['store']['book'][1]['author']&quot;, $result[1]);
-	$self-&gt;assert_equals(&quot;\$['store']['book'][2]['author']&quot;, $result[2]);
-	$self-&gt;assert_equals(&quot;\$['store']['book'][3]['author']&quot;, $result[3]);
+	$self-&gt;assert_equals(&quot;[\&quot;store\&quot;][\&quot;book\&quot;][0][\&quot;author\&quot;]&quot;, $result[0]);
+	$self-&gt;assert_equals(&quot;[\&quot;store\&quot;][\&quot;book\&quot;][1][\&quot;author\&quot;]&quot;, $result[1]);
+	$self-&gt;assert_equals(&quot;[\&quot;store\&quot;][\&quot;book\&quot;][2][\&quot;author\&quot;]&quot;, $result[2]);
+	$self-&gt;assert_equals(&quot;[\&quot;store\&quot;][\&quot;book\&quot;][3][\&quot;author\&quot;]&quot;, $result[3]);
 
 
 	$raw_result = $jp-&gt;run(\%test_structure, '$.store.!', {'result_type' =&gt; 'PATH'});
@@ -190,8 +213,69 @@ sub test_path_operations(){
 	@result = @{$raw_result};
 	$self-&gt;assert_equals(1, $#result);
 
-	$self-&gt;assert_equals(&quot;\$['store']&quot;, $result[0]);
-	$self-&gt;assert_equals(&quot;\$['store']&quot;, $result[1]);
+	$self-&gt;assert_equals(&quot;[\&quot;store\&quot;]&quot;, $result[0]);
+	$self-&gt;assert_equals(&quot;[\&quot;store\&quot;]&quot;, $result[1]);
 }
 
+sub test_includes_test(){
+	my $self = shift;
+	my $jp = JSONPath-&gt;new();
+	my $raw_result = undef;
+	my @result = undef;
+
+	$raw_result = $jp-&gt;run(\%test_structure, &quot;\$..book[?(@.ratings&gt;&lt;'good')]&quot;);
+		#[
+		#   {
+		#      &quot;ratings&quot; : [
+		#         &quot;good&quot;,
+		#         &quot;bad&quot;,
+		#         &quot;lovely&quot;
+		#      ],
+		#      &quot;category&quot; : &quot;fiction&quot;,
+		#      &quot;author&quot; : &quot;Evelyn Waugh&quot;,
+		#      &quot;title&quot; : &quot;Sword of Honour&quot;,
+		#      &quot;price&quot; : 12.99
+		#   }
+		#]
+	$self-&gt;assert($raw_result != 0);
+	@result = @{$raw_result};
+	$self-&gt;assert_equals(0, $#result);
+	$raw_result = $jp-&gt;run(\%test_structure, &quot;\$..ratings[?(@.&gt;&lt;'good')]&quot;);
+		#[
+		#   [
+		#      &quot;good&quot;,
+		#      &quot;bad&quot;,
+		#      &quot;lovely&quot;
+		#   ]
+		#]
+	$self-&gt;assert($raw_result != 0);
+	@result = @{$raw_result};
+	$self-&gt;assert_equals(0, $#result);
+	$self-&gt;assert_equals('bad', $result[0][1]);
+
+
+	$raw_result = $jp-&gt;run(\%test_structure, &quot;\$..book[?(@.ratings&gt;&lt;3)]&quot;);
+		#[
+		#   {
+		#      &quot;ratings&quot; : [
+		#         1,
+		#         3,
+		#         2,
+		#         10
+		#      ],
+		#      &quot;category&quot; : &quot;reference&quot;,
+		#      &quot;author&quot; : &quot;Nigel Rees&quot;,
+		#      &quot;title&quot; : &quot;Sayings of the Century&quot;,
+		#      &quot;price&quot; : 8.95
+		#   }
+		#]
+	$self-&gt;assert($raw_result != 0);
+	@result = @{$raw_result};
+	$self-&gt;assert_equals(0, $#result);
+	$self-&gt;assert_equals('reference', $result[0]{'category'});
+	$self-&gt;assert_equals('ARRAY', ref $result[0]{'ratings'});
+	$self-&gt;assert_equals(2, $result[0]{'ratings'}[2]);
+#
+#
+}
 return 1;</diff>
      <filename>tests/JSONPathTest.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,31 +1,47 @@
-{ &quot;store&quot;: {
-    &quot;book&quot;: [ 
-      { &quot;category&quot;: &quot;reference&quot;,
-        &quot;author&quot;: &quot;Nigel Rees&quot;,
-        &quot;title&quot;: &quot;Sayings of the Century&quot;,
-        &quot;price&quot;: 8.95
-      },
-      { &quot;category&quot;: &quot;fiction&quot;,
-        &quot;author&quot;: &quot;Evelyn Waugh&quot;,
-        &quot;title&quot;: &quot;Sword of Honour&quot;,
-        &quot;price&quot;: 12.99
-      },
-      { &quot;category&quot;: &quot;fiction&quot;,
-        &quot;author&quot;: &quot;Herman Melville&quot;,
-        &quot;title&quot;: &quot;Moby Dick&quot;,
-        &quot;isbn&quot;: &quot;0-553-21311-3&quot;,
-        &quot;price&quot;: 8.99
-      },
-      { &quot;category&quot;: &quot;fiction&quot;,
-        &quot;author&quot;: &quot;J. R. R. Tolkien&quot;,
-        &quot;title&quot;: &quot;The Lord of the Rings&quot;,
-        &quot;isbn&quot;: &quot;0-395-19395-8&quot;,
-        &quot;price&quot;: 22.99
-      }
-    ],
-    &quot;bicycle&quot;: {
-      &quot;color&quot;: &quot;red&quot;,
-      &quot;price&quot;: 19.95
-    }
-  }
+{ 
+	&quot;store&quot;: {
+		&quot;book&quot;: [ 
+			{
+				&quot;category&quot;: &quot;reference&quot;,
+				&quot;author&quot;: &quot;Nigel Rees&quot;,
+				&quot;title&quot;: &quot;Sayings of the Century&quot;,
+				&quot;price&quot;: 8.95,
+				&quot;ratings&quot;: [
+					1,
+					3,
+					2,
+					10
+				]
+			},
+			{ 
+				&quot;category&quot;: &quot;fiction&quot;,
+				&quot;author&quot;: &quot;Evelyn Waugh&quot;,
+				&quot;title&quot;: &quot;Sword of Honour&quot;,
+				&quot;price&quot;: 12.99,
+				&quot;ratings&quot; : [
+						&quot;good&quot;,
+						&quot;bad&quot;,
+						&quot;lovely&quot;
+					]
+			},
+			{
+				&quot;category&quot;: &quot;fiction&quot;,
+				&quot;author&quot;: &quot;Herman Melville&quot;,
+				&quot;title&quot;: &quot;Moby Dick&quot;,
+				&quot;isbn&quot;: &quot;0-553-21311-3&quot;,
+				&quot;price&quot;: 8.99
+			},
+			{
+				&quot;category&quot;: &quot;fiction&quot;,
+				&quot;author&quot;: &quot;J. R. R. Tolkien&quot;,
+				&quot;title&quot;: &quot;The Lord of the Rings&quot;,
+				&quot;isbn&quot;: &quot;0-395-19395-8&quot;,
+				&quot;price&quot;: 22.99
+			}
+		],
+		&quot;bicycle&quot;: {
+			&quot;color&quot;: &quot;red&quot;,
+			&quot;price&quot;: 19.95
+		}
+	}
 }</diff>
      <filename>tests/test.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9e98faf97dc7d4ea090f4e00d8ad643b1ecc2869</id>
    </parent>
  </parents>
  <author>
    <name>Kate Rhodes</name>
    <email>krhodes@akamai.com</email>
  </author>
  <url>http://github.com/masukomi/jsonpath-perl/commit/c927a0da540197636817c55c43ff1cbb11e2667f</url>
  <id>c927a0da540197636817c55c43ff1cbb11e2667f</id>
  <committed-date>2008-11-14T11:36:04-08:00</committed-date>
  <authored-date>2008-11-14T10:57:02-08:00</authored-date>
  <message>Added support for the new  &gt;&lt; &quot;includes&quot; operator

* &gt;&lt; operator will tell you if a hash includes the specified key,
	an array contains the specified element,
	or a string contains the specified substring</message>
  <tree>033d88014b897c8a60bb7a975c36652481f5da12</tree>
  <committer>
    <name>Kate Rhodes</name>
    <email>krhodes@akamai.com</email>
  </committer>
</commit>
