[TxMt] quick perl question

Xavier Noria fxn at hashref.com
Sun Feb 26 00:03:02 UTC 2006


On Feb 25, 2006, at 7:32, 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).

In Perl the second half of s///, the replacement part, behaves like a  
double-quoted string so to speak. In particular you need to escape  
the backslash:

     $ perl -pe 's/"/\\"/g' file1 ... filen

-- fxn





More information about the textmate mailing list