X-Git-Url: http://git.jankratochvil.net/?p=PerlMail.git;a=blobdiff_plain;f=contacts-n9k2mutt;h=6136f45b5dafb0bde280ffd06fcdbb97aeda01c9;hp=d916e88315d50072907561bea665c0d5a80e452a;hb=d3f7164a228e46921c5a9acaab1c086461e209bd;hpb=224d38f3ec3f29d52e1312a4fb1f59a63c836444 diff --git a/contacts-n9k2mutt b/contacts-n9k2mutt index d916e88..6136f45 100755 --- a/contacts-n9k2mutt +++ b/contacts-n9k2mutt @@ -17,6 +17,9 @@ # 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; }; @@ -79,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"; } }