J
johnnykimble
Hi all,
I've got to replace some characters in Base64 encoded data in a text
file but I'm having problems with the s/// operator mainly, I presume,
because of the presence of the '/' character in the input data.
For example, say I have a file containing the following:
<SomeNode>skdsSda3321/2=///==asda==////adasd/213/dw/ASDASd/ad</SomeNode>
I can pull out the Base64 here with:
$text = m/<SomeNode>(.+?)</SomeNode>/;
$base64stuff = $1;
Then I try to perform a substitution with:
$text =~ s/$base64stuff/hello/;
But this doesn't work. Anyone know what I can do to get this to work
properly?
Thanks,
JK
I've got to replace some characters in Base64 encoded data in a text
file but I'm having problems with the s/// operator mainly, I presume,
because of the presence of the '/' character in the input data.
For example, say I have a file containing the following:
<SomeNode>skdsSda3321/2=///==asda==////adasd/213/dw/ASDASd/ad</SomeNode>
I can pull out the Base64 here with:
$text = m/<SomeNode>(.+?)</SomeNode>/;
$base64stuff = $1;
Then I try to perform a substitution with:
$text =~ s/$base64stuff/hello/;
But this doesn't work. Anyone know what I can do to get this to work
properly?
Thanks,
JK