in reply to Re: Create a new operator, get LHS
in thread Create a new operator, get LHS

The var part can't be an arbitrarily complex expression, as it gets computed for each element of @list:

perl -E 'say q<Nope> unless grep { $_ eq $c++ } 1..10; say $c' Nope 10

Replies are listed 'Best First'.
Re^3: Create a new operator, get LHS
by SuicideJunkie (Vicar) on Sep 03, 2015 at 15:10 UTC

    Although it is a bit silly with side effects, that code works fine as you demonstrated.

    It isn't very complicated, but arbitrarily complex includes 'simple'. You're also free to start an OpenGL window, slam down some matrix transforms based on $_ and use that result as the grep condition.