aboutsummaryrefslogtreecommitdiff
path: root/challenge-004/doug-schrag/perl6/ch-2.p6
blob: 754f7849f62888f16c154a10becca2cc21b52e02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
use v6;

sub MAIN(:$file?, *@letters where *.all.chars == 1) {
    say @letters;
    my $file-handle = .IO with $file;
    $file-handle ||= $*IN;
    my $tiles = Bag.new(@letters>>.fc);
    for $file-handle.lines>>.fc -> $word {
        $word.comb.Bag (<=) $tiles
            and say $word;
    }

}