Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: replace string from Command Line (updated)by AnomalousMonk (Archbishop) |
on Oct 13, 2020 at 19:30 UTC ( [id://11122789]=note: print w/replies, xml ) | Need Help?? |
Interpolation control escapes (if that's the proper terminology) \Q \E to the rescue:s/CAST(CAST(hs_date ...) AS CHAR(08)) as .../... whatever .../g... backquoting all of those from a shell prompt is going to get ugly. s/\QCAST(CAST(hs_date ...) AS CHAR(08)) as ...\E/.../g (but those long strings still look scary). Note that the spaces in the search string must match exactly, and the match will fail if the string in the text being searched is broken across two or more lines Update: See Quote and Quote-like Operators (buried in the middle of the section) in perlop for a discussion of \l \u \L \U \F \Q \E escapes. Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|