You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m not sure if you’re aware of the long-standing efforts to remove the smartmatch feature from Perl. Perl v5.37.10 will finally start to issue deprecation warnings for it. Testing Neo4p in Perl blead today yields the following:
given is deprecated at lib/REST/Neo4p/Agent.pm line 214.
when is deprecated at lib/REST/Neo4p/Agent.pm line 215.
when is deprecated at lib/REST/Neo4p/Agent.pm line 239.
given is deprecated at lib/REST/Neo4p/Agent.pm line 276.
when is deprecated at lib/REST/Neo4p/Agent.pm line 277.
when is deprecated at lib/REST/Neo4p/Agent.pm line 280.
given is deprecated at lib/REST/Neo4p/ParseStream.pm line 32.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 33.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 36.
given is deprecated at lib/REST/Neo4p/ParseStream.pm line 152.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 153.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 160.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 165.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 172.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 181.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 195.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 205.
when is deprecated at lib/REST/Neo4p/ParseStream.pm line 227.
given is deprecated at lib/REST/Neo4p/Batch.pm line 46.
when is deprecated at lib/REST/Neo4p/Batch.pm line 47.
when is deprecated at lib/REST/Neo4p/Batch.pm line 67.
when is deprecated at lib/REST/Neo4p/Batch.pm line 71.
The test suite still seems to pass though. So, no immediate action is required. But the current plan is to remove the feature entirely with Perl v5.42 in 2025.
Good old if/elsif/else chains are a possible replacement. for blocks can sometimes be useful as a direct replacement for given, although next will behave differently inside of them. There are also a number of CPAN modules that offer C-style switch/case syntax, of which Syntax::Keyword::Match might be one of the more interesting, in spite of it currently being experimental.
The text was updated successfully, but these errors were encountered:
I actually have a working patch ready that would remove the use of smartmatch from REST::Neo4p, replacing it with Switch::Back. It’s really simple, basically just does this in a handful of files:
- use experimental 'smartmatch';+ use if $^V lt v5.41, experimental => 'smartmatch';+ use if $^V ge v5.41, 'Switch::Back';
However, P5P are currently working to revert the smartmatch deprecation altogether. So it doesn’t look like we’ll be needing that patch.
There are still the warnings on Perl v5.38 and v5.40 to address though.
johannessen
added a commit
to johannessen/rest-neo4p
that referenced
this issue
Dec 19, 2024
I’m not sure if you’re aware of the long-standing efforts to remove the
smartmatch
feature from Perl. Perl v5.37.10 will finally start to issue deprecation warnings for it. Testing Neo4p in Perl blead today yields the following:The test suite still seems to pass though. So, no immediate action is required. But the current plan is to remove the feature entirely with Perl v5.42 in 2025.
Good old
if
/elsif
/else
chains are a possible replacement.for
blocks can sometimes be useful as a direct replacement forgiven
, althoughnext
will behave differently inside of them. There are also a number of CPAN modules that offer C-styleswitch
/case
syntax, of which Syntax::Keyword::Match might be one of the more interesting, in spite of it currently being experimental.The text was updated successfully, but these errors were encountered: