host1:~lace/src/PerlMail/ update.
[PerlMail.git] / contacts-n9k2mutt
index bba3b46..03aa44d 100755 (executable)
@@ -1,6 +1,6 @@
 #! /usr/bin/perl
 # 
-#      $Id$
+#      $Id: contacts-n9k2mutt,v 1.13 2004/12/30 10:10:29 short Exp $
 # Copyright (C) 2002-2003 Jan Kratochvil <project-PerlMail@jankratochvil.net>
 # 
 # This program is free software; you can redistribute it and/or modify
 # 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; };
+$VERSION=do { my @r=(q$Revision: 1.13 $=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
 use strict;
 use warnings;
 
 require Getopt::Long;
-require PerlMail::Contacts::9000;
 require Mail::Address;
 
 
@@ -80,7 +82,11 @@ while (<>) {
                                        "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";
                }
        }