Hi All,
I'm getting this problem intermittenly i.e. it works for the first few runs, then it fails.
Getting this error:
Can't call method "entry" without a package or object reference at ... (the first entry call in the if test)
with the following code
How can I handle this (and set $Unknown = 1) without the eval statement throwing the error?
TIA, rotis23
I'm getting this problem intermittenly i.e. it works for the first few runs, then it fails.
Getting this error:
Can't call method "entry" without a package or object reference at ... (the first entry call in the if test)
with the following code
Code:
undef $mesg;
eval
{
$mesg = $ldap->search (
base => "ou=my,dc=domain,dc=com",
filter => "(mail=$recipient)",
attrs => ['l']
) || undef $mesg;
if(defined($mesg) && $mesg->entry(0))
{
$My_Location = $mesg->entry(0)->get_value('l');
}
else
{
$Unknown = 1;
}
};
if($@)
{
print "LDAP Error: $@\n";
}
TIA, rotis23