X-Git-Url: http://git.jankratochvil.net/?p=PerlMail.git;a=blobdiff_plain;f=contacts-n9k2mutt;h=6aa6561c53d9d4f0016da7e1dfbb29abef37d38d;hp=81aa704a3fa01ca823047fa567dcf7f471d4d76c;hb=c398068b75d290b596982eddc0fe23678a601c76;hpb=77c63c5ed9fa4b3c5d2110e70c3d66701dec763c diff --git a/contacts-n9k2mutt b/contacts-n9k2mutt index 81aa704..6aa6561 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; }; @@ -24,7 +27,6 @@ use strict; use warnings; require Getopt::Long; -require PerlMail::Contacts::9000; require Mail::Address; @@ -32,9 +34,16 @@ Getopt::Long::Configure( "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({ @@ -50,7 +59,7 @@ while (<>) { "iscompany"=>($record{"Name"} && $record{"Company"} && $record{"Name"} eq $record{"Company"}), })); } @record); - } PerlMail::Contacts::9000->in($_)); + } $class->in($_)); my @nicked=map({ my $data=$_; my($name,$mail,$attr,$iscompany)=map(($data->{$_}),qw(name mail attr iscompany));