in reply to Re^2: I would have expected a syntax error here
in thread Solved! I would have expected a syntax error here

indirect already exists on CPAN:

>perl -M-indirect -wle "got to here today! (20180520)" Indirect call of method "here" on object "today" at -e line 1. Indirect call of method "got" on object "to" at -e line 1. Can't locate object method "here" via package "today" (perhaps you for +got to load "today"?) at -e line 1.
>perl -wle "got to here today! (20180520)" Can't locate object method "here" via package "today" (perhaps you for +got to load "today"?) at -e line 1.

You can put it either into PERL5OPT or just at the top of your code:

no indirect;

Replies are listed 'Best First'.
Re^4: I would have expected a syntax error here
by roboticus (Chancellor) on Oct 19, 2018 at 17:45 UTC

    Corion:

    While I'm going to try to use the yadda operator, I think I'll stick this in my PERL5OPT since:

    1. I'm already using PERL5OPT,
    2. who knows how many of these bombs may be ticking on my hard drive, and
    3. I don't know how long it'll take me to get into the habit of using ...

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re^4: I would have expected a syntax error here
by LanX (Saint) on Oct 19, 2018 at 18:30 UTC
    Nice ...

    ... but I think it should allow to add new as exception. (couldn't find it)

    There is far too much legacy code using an indirect new as constructor.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      You don't need to make it fatal and you also don't need to enable it globally.

      If it is for your own code, you can slowly fix that code, eliminating those warnings.