First, add "use strict;" and "use warnings;" to your script.

$mesg->code() returns true (defined value, not zero and not an empty string) and $mesg->error() returns "No such object".

Alexander

Asif Iqbal wrote:

Can you tell why $mesg->code && die $mesg->error; is giving the following
error?

No such object at ./mutt-ldap.pl line 11, <DATA> line 225


#! /usr/bin/perl

use Net::LDAP;

$ldap = Net::LDAP->new('localhost:9389') or die "$@";

$mesg = $ldap->bind ;

$mesg = $ldap->search(base => "ou=uswest.com", filter => "(uid=iqbala)");

$mesg->code && die $mesg->error;

foreach $entry ($mesg->entries) { $entry->dump; }

$mesg = $ldap->unbind;


--
Alexander Foken
mailto:[EMAIL PROTECTED]  http://www.foken.de/alexander/

Reply via email to