johannessen / neo4j-driver-perl

Neo4j graph database driver (Bolt/Jolt) for Perl
https://metacpan.org/pod/Neo4j::Driver
Artistic License 2.0
5 stars 1 forks source link

Driver errors on old Perls for queries not beginning with a letter #13

Closed gentstr closed 3 years ago

gentstr commented 3 years ago

Writing a multi-line query with leading whitespace will error.

my $query = q{
     MATCH (n)
    RETURN n
};

Can't call method "isa" without a package or object reference at .../vendor/perl/site/lib/Neo4j/Driver/Transaction.pm line 69.

Resolution is to check for ref before calling isa()

if (ref $query && $query->isa('REST::Neo4p::Query')) {
johannessen commented 3 years ago

Hi @gentstr, I can reproduce this issue with Perl 5.10 and 5.12 (but not with 5.30 or 5.32).

Thanks a lot for reporting this!

johannessen commented 3 years ago

This should be fixed in release 0.22. Please let me know if you have any further issues!

Out of curiosity, can I ask: Which version of Perl are you currently using?