> -----Original Message-----
> From: Panel Vincent - A53 [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 30, 2002 10:24 AM
> To: [EMAIL PROTECTED]
> Subject: Really newbie question
> 
> 
> I've made a script that looks like this
> 
> "
> #!/usr/bin/perl -w
> use Net::LDAP::LDIF;
> use Net::LDAP::Entry;
> $file= $ARGV[0];
> open(LDIF, $file) || die "Failed to open file $ARGV[0] : $!";
> $ldif = Net::LDAP::LDIF->new(LDIF);
> while (not $ldif->eof()) {
>       $entry = $ldif->read_entry();
> };
> "
> 
> Perl is giving me the following error :
> "
> Can't call method "eof" on undefined value at ... line ...
> "
> 
> Is this line : "$ldif = Net::LDAP::LDIF->new(LDIF);" correct 
> ? (I just want
> to make a new object with the Net::LDAP::LDIF properties, 
> what's wrong ?)

The error message means $ldif is undef. I suspect the Net::LDAP::LDIF->new()
call is failing for some reason. You need to check the docs to see how to
figure out what the problem is, and put some code in to handle the error.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to