Could you post some input and expected output? That would make it easier for me (and perhaps others) to see what exactly you're trying to accomplish, in practical terms.
On Fri, 22 Nov 2019 14:39:33 +0100 Marc Chantreux <e...@phear.org> wrote: > hello people, > > removing shell scripts is a good way to learn raku and compare. > today i want to replace this: > > fix () { > awk -F, '{print $1" "$2}' | > sort -u | > awk -F" " '{ > if (seen == $1) print "\t"$2; > else { seen = $1; print $1 } > }' > } > > and i got this: > > fix () perl6 -e ' > my %section; > lines.map: { > my ($s,$ss) = .split(","); > %section{$s;$ss} = 1; > } > %section.keys.map: > { .say for $_ , |%section{$_}.keys.map: {"\t$_"} } > ' > > ";" to walk in the hoh is really awesome but i don't know even know > from where i know it and what's the object underneath. > it isn't listed in the list of operators > (https://docs.perl6.org/language/operators). > > i would like to know because it would be nice to make this block > > my ($s,$ss) = .split(","); > %section{$s;$ss} = 1; > > a one liner so i'm searching for something like > > %section{ .split(",").walkTheHash } = 1; > > any help will be warmly welcome. > > regards > marc -- With kind regards, Patrick Spek www: https://www.tyil.nl/ mail: p.s...@tyil.nl pgp: 1660 F6A2 DFA7 5347 322A 4DC0 7A6A C285 E2D9 8827 social: https://soc.fglt.nl/tyil git: https://gitlab.com/tyil/
pgpCNSMENxBRN.pgp
Description: OpenPGP digital signature