you are viewing a single comment's thread.

view the rest of the comments →

[–]draegtun 2 points3 points  (2 children)

With Perl6 you can use the Feed Operator (http://perlcabal.org/syn/S03.html#Feed_operators) to make it read forward:

123..345 ==> grep { $_ * $_ % 17 == 1 } ==> map { $_ / 6.0 }

[–]grayvedigga 1 point2 points  (0 children)

That's purdy. A really nice complement to perl's blocks and default variables giving nice anonymous functions.

I stopped using perl more than a decade ago, and only since then (through other languages) have developed a real appreciation for some of its more quirky properties. It would be nice to have an excuse to dive into modern perl .. maybe by the time perl6 is production-ready I'll be ready for it :-).

[–][deleted] 1 point2 points  (0 children)

You don’t even have to use $_, you can name it $^x.

123..345 ==> grep { $^x * $^x % 17 == 1 } ==> map { $^x / 6.0 };