$.[0:] #### foreach $elem ($json_path->values($json)) { ... } #### perl -MJSON::Path -Mstrict -wE 'my $json = q{["string1","string2"]}; my $json_path = JSON::Path->new(q{$.[0:]}); foreach my $elem ($json_path->values($json)) {say "##$elem$$"}'
## foreach $elem ($json_path->values($json)) { ... } ##
## perl -MJSON::Path -Mstrict -wE 'my $json = q{["string1","string2"]}; my $json_path = JSON::Path->new(q{$.[0:]}); foreach my $elem ($json_path->values($json)) {say "##$elem$$"}'