On 21/2/07 5:01, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi everyone, > > I have a question about the "ldap_error_desc" function from > Net::LDAP::Util. I am using Net::LDAP in a CGI form, along with the > "fatalstobrowser" function. > Whenever I call the "ldap_error_desc" function, the LDAP error is > displayed in the browser, but along with the following message: > > "at /opt/opensrc/cgi-bin/form_processor.cgi line 199." > > I do not want this portion displayed. Is there a way to prevent this from > being displayed in "ldap_error_desc". When I use "ldap_error_text", the > script name and line number are not displayed. > > Here is my error code : if ($newEntry -> code) { die > ldap_error_desc($newEntry -> code); } The die function appends the script name and line number to the output if the final argument you're passing it does not end in \n. So just tag on a \n: die ldap_error_desc($newEntry->code) . "\n"; Also investigate the Carp module, as it is meant to provide "more useful" errors. Cheers, Chris