OS: Solaris 10 ( X86 ) Hi I am a new bie and have been coding a relatively easy structured programming method. I have a snippet of my program which will:
#-----Running LDAPMODIFY Against The Ldif File Created-----# sub RunUpdate { print "--Updating Directory server. Please wait for a moment....\n +\n"; my $resultLdapSearch = `ldapmodify -h $ldap_server -D "cn=Director +y Manager" -w $dir_mgr_pwd -f $ldap_modify_file`; #print "resultLdapSearch: $resultLdapSearch\n"; }
When running the program I get a output error due to the ldapmodify command is trying to update and existing field, as shown below:
bash-2.05# perl 4-run_update_attributes.pl ********************************************************************** +******* Step #4 - The Script WILL NOW Update The Users "Company" and "Co" Attr +ibutes ********************************************************************** +******* Do you want to continue [y]: --Updating Directory server. Please wait for a moment.... ldap_modify_s: Type or value exists ********************************************************************** +* See Result: ----------- Log Output file (verified): 01152008.log ********************************************************************** +*
As you notice, the error "ldap_modify_s: Type or value exists" appears from the "ldapmodify" that I executed. I need to know how do I capture this value and once I find out, I will write some codes to handle this error. Please advice.

In reply to How to capture error messages... by fabster01

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.