Assuming that you need to change 'ABCD' into '\AB\CD', there should be an easier way:
sub enc_hex { my $out = unpack('H*', (shift)); $out =~ s/\G(..)/\\$1/g; return $out; }
This uses the regex engine to advance through the string two characters at a time, inserting backslashes before each pair in the output. See perlre and perlop for more details.
In reply to Re^4: Peculiar problem with Net::LDAPS and AD LDAP
by jcb
in thread Peculiar problem with Net::LDAPS and AD LDAP
by desertrat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |