summaryrefslogtreecommitdiff
path: root/bayes
blob: c7c81bfa00da8e38e66a07cd125a153fb6055d45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env perl6 
use v6.d.PREVIEW;
use lib 'lib';
use MaildirIndexer::ScanDir;
use MaildirIndexer::Parser;
 
sub MAIN($maildir{
    my $file-supply = scan-dir($maildir);
    my $file-channel = $file-supply.Channel;
    for ^10 {
        start react {
            whenever $file-channel -> $file {
                if $file.e && $file.f {
                    my $email = parse-email($file,:headers-only);
                    say "{$file} - {$email<headers><Subject>}";
                }
            }
        }
    }
 
    react whenever signal(SIGINT{ exit }
}