in reply to Where does the spurious error message come from?

Using the first service I've found when searching for "perl playground":

https://perlbanjo.com/35ee31a0ab

The spurious error message appeared in 5.20 and got fixed in 5.38.

  • Comment on Re: Where does the spurious error message come from?

Replies are listed 'Best First'.
Re^2: Where does the spurious error message come from?
by sn1987a (Curate) on Aug 04, 2023 at 17:39 UTC

    From the results at your link, 5.20 was the first version where List::Util contained any. It worked as expected in that version.

    It broke in 5.22, with the spurious error message

Re^2: Where does the spurious error message come from?
by syphilis (Archbishop) on Aug 05, 2023 at 02:29 UTC
    The spurious error message appeared in 5.20 and got fixed in 5.38.

    I think the following excerpt from the 5.38.0 perldelta is relevant here:
    Syntax errors no longer produce "phantom error messages" Generally perl will continue parsing the source code even after encountering a compile error. In many cases this is helpful, for instance with misspelled variable names it is helpful to show as m +any examples of the error as possible. But in the case of syntax error +s continuing often produces bizarre error messages and may even caus +e segmentation faults during the compile process. In this release th +e compiler will halt at the first syntax error encountered. This mea +ns that any code expecting to see the specific error messages we used + to produce will be broken. The error that is emitted will be one of t +he diagnostics that used to be produced, but in some cases some messa +ges that used to be produced will no longer be displayed. See "Changes to Existing Diagnostics" for more details.
    Cheers,
    Rob