Keep It Simple, Stupid | |
PerlMonks |
Re^4: Peculiar problem with Net::LDAPS and AD LDAPby jcb (Parson) |
on Feb 21, 2021 at 04:32 UTC ( [id://11128614]=note: print w/replies, xml ) | Need Help?? |
Assuming that you need to change 'ABCD' into '\AB\CD', there should be an easier way:
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 Section
Seekers of Perl Wisdom
|
|