Subject: | given is experimental / when is experimental |
Running with a recent perl emits a lot of warnings:
➔ perl -MREST::Neo4p -e1
given is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Agent.pm line 213.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Agent.pm line 214.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Agent.pm line 237.
given is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 72.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 73.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 80.
given is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 149.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 150.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 153.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 160.
given is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 215.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 216.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 219.
given is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 263.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 264.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 272.
given is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 279.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 280.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 287.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 296.
given is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 360.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 361.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 364.
when is experimental at /opt/xt/xt-perl/lib/site_perl/REST/Neo4p/Query.pm line 378.
I've attached a file that should resolve this, as well as a test to catch any unexpected warnings when using the main module.
Subject: | test_warnings.patch |
diff -Naur REST-Neo4p-0.2242-orig/t/99.warnings.t REST-Neo4p-0.2242/t/99.warnings.t
--- REST-Neo4p-0.2242-orig/t/99.warnings.t 1970-01-01 01:00:00.000000000 +0100
+++ REST-Neo4p-0.2242/t/99.warnings.t 2014-05-09 11:44:46.000000000 +0100
@@ -0,0 +1,10 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Warnings;
+
+use REST::Neo4p;
+
+done_testing;
Subject: | use_experimental.patch |
diff -Naur REST-Neo4p-0.2242-orig/Build.PL REST-Neo4p-0.2242/Build.PL
--- REST-Neo4p-0.2242-orig/Build.PL 2014-05-09 11:42:33.000000000 +0100
+++ REST-Neo4p-0.2242/Build.PL 2014-05-09 12:02:47.000000000 +0100
@@ -16,6 +16,7 @@
'LWP::UserAgent' => 6.04,
'Exception::Class' => 1.3,
'Tie::IxHash' => 0,
+ 'exception' => 0,
perl => 5.010
},
configure_requires => {
diff -Naur REST-Neo4p-0.2242-orig/lib/REST/Neo4p/Agent.pm REST-Neo4p-0.2242/lib/REST/Neo4p/Agent.pm
--- REST-Neo4p-0.2242-orig/lib/REST/Neo4p/Agent.pm 2014-05-09 11:42:33.000000000 +0100
+++ REST-Neo4p-0.2242/lib/REST/Neo4p/Agent.pm 2014-05-09 11:57:14.000000000 +0100
@@ -210,6 +210,9 @@
my ($rq, $action, @args) = @_;
$self->{_errmsg} = $self->{_location} = $self->{_decoded_content} = undef;
my $resp;
+
+ use experimental 'smartmatch';
+
given ($rq) {
when (/get|delete/) {
my @url_components = @args;
diff -Naur REST-Neo4p-0.2242-orig/lib/REST/Neo4p/Query.pm REST-Neo4p-0.2242/lib/REST/Neo4p/Query.pm
--- REST-Neo4p-0.2242-orig/lib/REST/Neo4p/Query.pm 2014-05-09 11:42:33.000000000 +0100
+++ REST-Neo4p-0.2242/lib/REST/Neo4p/Query.pm 2014-05-09 11:59:21.000000000 +0100
@@ -69,6 +69,7 @@
);
}
eval {
+ use experimental 'smartmatch';
given ($endpt) {
when (/cypher/) {
$agent->$endpt(
@@ -146,6 +147,7 @@
return unless defined $self->tmpf;
my $row;
my ($token_type, @data) = @{$jsonr->get_token};
+ use experimental 'smartmatch';
given ($token_type) {
when (/start_array/) { # return from cypher endpt
$row = $jsonr->slurp;
@@ -212,6 +214,7 @@
return 'bareword';
}
elsif (defined $resp->{self}) {
+ use experimental 'smartmatch';
given ($resp->{self}) {
when (m|data/node|) {
return 'Node';
@@ -260,6 +263,7 @@
my $in_data;
while ( my $ret = $jsonr->get_token ) {
my ($token_type, @data) = @$ret;
+ use experimental 'smartmatch';
given ($token_type) {
when ('start_property') {
if ($data[0] && $data[0] eq 'data') {
@@ -357,6 +361,7 @@
my ($row) = @_;
my @ret;
foreach my $elt (@$row) {
+ use experimental 'smartmatch';
given ($elt) {
when (!ref) { #bareword
push @ret, $elt;