Hacker News new | past | comments | ask | show | jobs | submit login

Note that:

    while (<>) { ($h{$_}++ == 1) && push (@outputarray, $_); };
Would be written as the following in Raku:

    my @output-array = lines.unique;



Actually, since the Perl 5 example doesn't chomp (remove newlines), the Raku version would need to be:

    my @output-array = lines(:!chomp).unique;
where the `:!chomp` is a named parameter representing a `False` value for the named parameter `chomp`. AKA, `chomp => False`.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: