[TxMt] quick perl question

Dominic Mitchell dom at happygiraffe.net
Sat Feb 25 16:20:13 UTC 2006


Charilaos Skiadas wrote:
> On Feb 25, 2006, at 12:32 AM, Oliver Taylor wrote:
> 
>> Forgive the ignorance...
>>
>> perl -pe '
>>     s/"/\"/g;
>> '
>>
>> This there any reason that the above wouldn't work? I'm guessing it 
>> has to with the "-pe" options (which I know nothing about).
> 
> It would probably help if you told us what you wanted it to do. I'm 
> guessing you want it to replace all " with \", in which case you would 
> want to escape the \, i.e. s/"/\\"/g

It's just worth pointing out that it's the shell (bash) which is 
managing to strip out the backslashes, even inside single quotes. 
Perl's not to blame for once.  :-)

-Dom



More information about the textmate mailing list