$rplc = "\\x41"; print $rplc; # prints the string \x41 $_ = "apples"; s@a@$rplc@; # variable containing the string \x41 used in RHS print; # - not interpolated to the char A $_ = "apples"; s@a@\x41@; # \x41 hardcoded into RHS print $_; # - interpolated to the char A __END__ outputs: \x41 \x41pples Apples
In reply to Re^8: hex code passed from command line is interpreted literally in substitution
by Allasso
in thread hex code passed from command line is interpreted literally in substitution
by Allasso
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |