I have a file called \"test.txt\" like that:
hello world
it is, just a \'hello world\' string. If I use a perl regex:
perl -pe
The redirection takes place while your shell is parsing your command line. This happens before the actual command is executed, thus the file you redirect to is overwritten before you have the chance to read it.