Hello,
following perl script, using Net::LDAP 0.30 , sometimes causes following
problem :
---------------------------------------
$ldap = Net::LDAP->new('<ldap-server>) or &DEBUG("Failed to open LDAP
connection : $@");
$ldap->bind or &DEBUG("Failed to bind to LDAP : $@");
&DEBUG("LDAP connection opened ") ;
undef $mesg ;
$mesg = $ldap->search( base => "o=tietoenator corp", scope => "sub",
filter => "(&(cn=$fullname)(ba=Processing & Network))" );
if ( defined $mesg )
{
if ( $mesg->code == LDAP_SUCCESS ) # no errors
{ $cnt = $mesg->count; }
else { $cnt = 0; }
}
---------------------------------------
The above script is continuously , about once each minute, doing the
above search, and most of the times everything works ok.
However, script sometimes exits with error message
'Can't call method "code" without a package or object reference at
/home/niv/net_updater.pl line 205, <GEN4> line 52.'
It seems to me that the "defined" test is not enough to make sure that
$mesg is usable as an object.
If the above "$ldap->search" for some reason fails, what would be the
best way to test it ( and keep the script alive) ?
Regards,
Tapio Niva
email: [EMAIL PROTECTED]