summaryrefslogtreecommitdiff
path: root/mailall.pl
blob: 449e967436abc2f91c253b583fc5990ead6ad75c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl -w
use strict;

my $data_dir = shift @ARGV;

my $n = 0;
my %address;

foreach my $file ( glob("$data_dir/*") ) {
  open(FILE,"<$file") or die $!;
  while (<FILE>) {
    /\b(\w[\w\-\.\+]*\@(([\w\.\-]+\.)+\w+))\b/ or warn "can't parse line: $_\n";
    $address{lc($1)}=1;
    $n++;
  }
}

print scalar(keys(%address)), " ($n)\n";
print join(",",keys %address),"\n";