1 2 3 4 5 6 7 8 9 10 11 12
unit sub MAIN (*@file); my %index; for @file.map(*.?IO).grep({.?f && .?r}) -> $file { %index.push: $file.comb(/\w+/, :match).hyper.map({ .Str.fc => $($file.path => .pos,) }); } while my $word = prompt 'Find? ' { %index{$word.fc}».say; }