Ron
Mon, 02 Jun 2008 17:08:15 -0700
I am running the following script to import my 1900 + contacts into the
global address room. I am getting stuck on line 28, as indicated.
#!/usr/bin/perl -w
use strict;
use Net::Telnet ();
my ($s);
my $t = new Net::Telnet;
my $user = 'ron';
my $pass = 'rgp1953';
my $fl = '/media/disk address.vcf';
my $target = 'Global Address Book';
$t->open(Host => 'localhost', Port => 504);
$s = $t->getline;
$t->print("USER $user");
$s = $t->getline;
$t->print("PASS $pass");
$s = $t->getline;
$t->print("GOTO $target");
$s = $t->getline;
$t->print('ENT0 1|||4');
$s = $t->getline;
$t->print('Content-type: text/x-vcard; charset=UTF-8');
$t->print("\n");
open(IN, "<$fl");
while (<IN>) *************8THIS IS THE AREA THE PROGRAM STICKS
IN***********
{
if (/^$/)
{
$t->print('000');
$t->print('ENT0 1|||4');
$s = $t->getline;
$t->print('Content-type: text/x-vcard; charset=UTF-8');
$t->print("\n");
}
else
{
if (/FN:/)
{
my @name = split(/:/,$_);
print "Adding $name[1]";
}
$t->print("$_");
}
}
$t->print('000');
close(IN);
exit;
Following is the message I get when I run the script: readline() on closed
filehandle IN at citadel.pl line 28.
Following is an example of the file I amattempting to import:
BEGIN:VCARD
EMAIL:[EMAIL PROTECTED]
N:Ann;Ann Bomgaars;;;
UID:006oPNgA2n
VERSION:3.0
END:VCARD
BEGIN:VCARD
EMAIL:[EMAIL PROTECTED]
N:Jamie;Jamie Wilkie;;;
UID:00oNifbsb0
VERSION:3.0
END:VCARD
BEGIN:VCARD
EMAIL:[EMAIL PROTECTED]
N:Lorrie;Lorrie Beck;;;
UID:03BDB06LqO
VERSION:3.0
END:VCARD
BEGIN:VCARD
EMAIL:[EMAIL PROTECTED]
N:Callie;Callie Wilburn;;;
UID:05ioyWWvap
VERSION:3.0
END:VCARD
Thanks in advance for your suggestions.