6 binmode STDOUT, ':utf8';
12 if ($x =~ m{^\s*=\?}) {
13 $x = Encode::decode('MIME-Header', $x);
15 return Email::Address->parse($x);
19 return if $curr eq "";
20 return if $curr =~ /^#/;
21 my @a = split /\t/, $curr;
22 # print join("", map { "<$_>" } @a), "\n";
23 @a <= 5 or die "Too many fields: $curr\n";
24 my ($nick, $full, $addr, $fcc, $note) = @a;
27 print STDERR "Ignoring because of no nick: $curr\n";
32 if ($addr =~ m{^\((.*)\)$}) {
35 while ($addr =~ m{\G,*(([^,"]|"[^"]*")+)}g) {
37 my @as = parse_addr($x);
38 @as == 1 or die "Cannot parse $x\n";
41 pos $addr and die "Cannot parse $addr\n";
43 @addrs = parse_addr($addr);
44 @addrs == 1 or die "Cannot parse $addr\n";
48 if ($full =~ m{^\s*=\?}) {
49 $full = Encode::decode('MIME-Header', $full);
52 if ($full =~ m{^(.*), (.*)$}) {
57 if (!length $a->phrase) {
63 # for my $a (@addrs) {
64 # print "\t", $a->format, "\n";
67 print "alias $nick ", join(", ", map { $_->format } @addrs), "\n";