# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Name: Lastname Firstname "nick1" "nick2", dropped text
+# Company: same as Name to indicate company record
+
use vars qw($VERSION);
$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
use warnings;
require Getopt::Long;
-require PerlMail::Contacts;
require Mail::Address;
"no_ignorecase",
"bundling",
);
+my $opt_9000;
die if !Getopt::Long::GetOptions(
+ "9000"=>\$opt_9000,
);
+my $type="9210";
+$type="9000" if $opt_9000;
+my $class="PerlMail::Contacts::$type";
+eval "require $class;1;" or die "Cannot load loader $class: $!";
+
undef $/;
while (<>) {
my @data=map({
"iscompany"=>($record{"Name"} && $record{"Company"} && $record{"Name"} eq $record{"Company"}),
}));
} @record);
- } PerlMail::Contacts->import($_));
+ } $class->in($_));
my @nicked=map({
my $data=$_;
my($name,$mail,$attr,$iscompany)=map(($data->{$_}),qw(name mail attr iscompany));
"obj"=>Mail::Address->new(($name_force || $name),$mail),
},@nicks);
} @data);
+ my %dupe;
for (@nicked) {
- print "alias ".$_->{"nick"}." ".$_->{"obj"}->format()."\n";
+ my $nick=$_->{"nick"};
+ my $dupe=$dupe{$nick}++;
+ $nick.=".$dupe" if $dupe;
+ print "alias $nick ".$_->{"obj"}->format()."\n";
}
}