in reply to How to capture error messages...

IPC::Open3 or IPC::Run provide facilities for running external programs and capturing standard error separately from standard output, but be warned, it's easy to deadlock.

However you may find that using Net::LDAP better suits your needs. Since the attempted LDAP updates occur within your program checking the result is fairly easy.

use Net::LDAP; my $ldap = Net::LDAP->new( ... ); my $mesg = $ldap->modify( ... ); if ( $mesg->is_error() ) { ... }