New perl warnings "Use of implicit split to @_ is deprecated at ..." with ET-Sept 28 2020 devel

Issue #2466 resolved
Zach Etienne created an issue

After configuring and when I start make with the latest ET development version I get a number of warnings:

Use of implicit split to @_ is deprecated at [….]

where [….] = /Cactus/repos/flesh/lib/sbin/parameter_parser.pl line 385, 396, 409, 422, 435, 962

and = Cactus/repos/flesh/lib/sbin/GridFuncStuff.pl line 1073 and 1093

I’m using perl (--version):

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Comments (5)

  1. Roland Haas

    I do not see these warnings on my workstation with Perl v5.30.3 but do see them on BW with Perl v5.10.0.

    The code in question is:

    print $sep . scalar(split(" ", $parameter_database{"\U$thorn $block\E variables"})) . " $block";
    

    and the warning goes away if I change it to:

    my @vars = split(/ /, $parameter_database{"\U$thorn $block\E variables"});
    print $sep . scalar(@vars) . " $block";
    

    The code has been like this since 1999 so this must be triggered now by something else, most likely by the $parameters_database hash now actually containing a value while having been empty (due to a typo) before.

    And the newer versions of Perl just no longer implicitly assign to @_ (which we are however not using anyway).

    The warning seems to be triggered when calling split in scalar context, ie things like foreach my $v (split(/ /, $vars)) {…} is fine.

  2. Log in to comment