in reply to Re^7: hex code passed from command line is interpreted literally in substitution
in thread hex code passed from command line is interpreted literally in substitution
$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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: hex code passed from command line is interpreted literally in substitution
by Anonymous Monk on Mar 10, 2011 at 17:06 UTC | |
by Allasso (Monk) on Mar 10, 2011 at 17:22 UTC | |
by Anonymous Monk on Mar 10, 2011 at 18:04 UTC | |
by Allasso (Monk) on Mar 11, 2011 at 13:22 UTC |