/usr/bin/perl -w use strict; my $import_file = shift || 'addresses'; my @tmp; my %import_data =( 'id' => '', 'username' => '', 'domain' => '', 'address' => '', 'firstname' => '', 'lastname' => '', 'nickname' => '', 'type' => '', 'street' => '', 'city' => '', 'state' => '', 'zip' => '', 'country' => '', 'company' => '', 'home_phone' => '', 'work_phone' => '', 'pager' => '', 'cellular' => '', 'fax' => '', 'other' => '', 'birth_month' => '', 'birth_day' => '', 'birth_year' => '', 'birthday' => 'undef', 'title' => '', 'status' => '', 'time_stamp' => '', 'middleinitial' => '', 'nameprefix' => 'undef', 'namesuffix' => 'undef', 'street2' => '', 'website' => '', 'notes' => '', 'department' => 'undef', 'assistant' => 'undef', 'dstreet' => '', 'dstreet2' => '', 'dcity' => '', 'dstate' => '', 'dzip' => '', 'dcountry' => '', 'dphone1' => 'undef', 'dphone2' => 'undef', 'daddress' => '', 'dspouse' => 'undef', 'danniversary_day' => '', 'danniversary_month' => '', 'dnotes' => 'undef', 'dwebsite' => '', 'daddress2' => '', 'danniversary_year' => '', 'category' => '', 'prime_phone' => '', ); open(FILE, "< $import_file") or die "Cannot open $import_file ERR: $!\n"; while () { @tmp = split /\t/; #map @tmp to %import_data here #then call a sub-routine to manipulate } close FILE;