in reply to Re^3: perlcritic and MCE::Loop
in thread perlcritic and MCE::Loop

Thanks, I missed that, working now

My previous "solution" didn't work, code ran but mce_loop did nothing.

All seems to be working now and perlcritic happy

Replies are listed 'Best First'.
Re^5: perlcritic and MCE::Loop
by LanX (Saint) on Feb 20, 2021 at 21:02 UTC
    > My previous "solution" didn't work, code ran but mce_loop did nothing.

    That's obvious.

    Defining an anonymous sub won't execute it but return the code-ref.

    DB<39> p sub { print "run @_" } # returns ref CODE(0x2e80a90) DB<40> sub{ print "run @_" }->(1..3) # calls ref run 1 2 3 DB<41>

    Though I'm a bit surprised, my muscle memory wanted brackets around the ref for precedence:

    ( sub{ print "run @_" } )->(@_)

    this could still be needed in other contexts. (or - more likely - it's just cargo cult from JS ;)

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

Re^5: perlcritic and MCE::Loop
by LanX (Saint) on Feb 20, 2021 at 15:56 UTC
    > and perlcritic happy

    Still strange, there is a bug somewhere in this policy.

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