in reply to Catching typos

Nothing catched this, obviously perl -cw myModule.pm didn't

A quick test on the commandline shows that this is treated as indirect object notation which perlcritic should pick up on. Perhaps that's one way to go.

Did your test suite not raise failures?


🦛

Replies are listed 'Best First'.
Re^2: Catching typos
by LanX (Saint) on Jan 06, 2021 at 17:09 UTC
    There is at least a cpan pragma indirect to disable that notation.

    Unfortunately it requires XS.

    Would be nice to have something alike in core.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Re^2: Catching typos (indirect method precedence)
by LanX (Saint) on Jan 06, 2021 at 19:44 UTC
    I think you nailed it ...

    But I didn't expect this precedence

    d:\tmp\pm>perl -MO=Deparse -e "reeturn $self->someMethod()" $self->reeturn->someMethod; -e syntax OK d:\tmp\pm>

    Obfuscators would party now... ;-)

    wait ... look at this:

    d:\tmp\pm>perl -MO=Deparse -e "A B C D" 'B'->A('D'->C); -e syntax OK d:\tmp\pm>

    Forget the lockdowns and lets meet for 99 beers ... xD

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery