The 1st/2nd Perl 6 solution is interesting because you read it from left to right treating map,grep and sort as object methods.
The Perl 5 version is read from right to left treating map,grep and sort as functions. I've attempted to do it the functional way in Perl 6 and got the following to work on Rakudo.
use v6; say reverse .words for map {.[1]} ,sort( map { [.words[*-1],$_] } ,grep {/SRC1/} ,lines() );
The syntax for doing Perl 6 functionally seems to be more untidy than the Perl 5 version and make it a bit harder to read. The required comma, the required parenthesis around sort. Its not too bad though. Will get some getting use to.
In reply to Re^2: Perl 6 implementation of the following Perl 5 code
by konnjuta
in thread Perl 6 implementation of the following Perl 5 code
by konnjuta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |