Do you really mean '$pw' with single quotes? (no quotes should be necessary at all)
Also, I've never actually used Convert::BER at this level, I thought Net::LDAP automatically converted strings in the replace() data as necessary.
ie. sth like:
in reply to Change Password on AD via Perl/LDAPS/Convert::BER
Also, I've tended to fetch an entry, call its replace/add methods and then update() it, but that should just fall through to this method...
$ldaps->modify(dn => $tempDN,
changes => [ replace =>[unicodePwd => $pw]]);