in reply to Re: Perl command line search and replace
in thread Perl command line search and replace

Actually, if the system shell is sh or bash, the extreme problem with every $ variable in the perl script needing to be backslashed as \$ only applies if the script is in double quotes. A single quoted script will be passed intact to perl, needing backslashes only in front of single quotes.

For instance, the nasty

perl -wle "\$x=42; print \$x"
can be written as a fairly tolerable
perl -wle '$x=42; print $x'