Yes, and that works with -i as well.
Doesn't seem to:
> perl -i.bak -pe "BEGIN{s!^(\s)!./$1!,s/^/</,s/$/\0/ for @ARGV} s/fo
+o/bar/" bar
Can't open <bar: No such file or directory.
> perl -v
This is perl, v5.10.0 built for cygwin-thread-multi-64int
(with 6 registered patches, see perl -V for more detail)
Putting '<' on the front breaks -i. Putting "\0" on the end breaks -i.bak. Prepending "./" (at least on platforms that support that directory syntax) doesn't break either use of -i, but that still leaves files that end with space or '|' out.
But I still boggle that you think it is better to make the 99% case this much harder while refusing to make the "cute hack" magical case any harder at all. So much for proper Huffman coding (much less defaulting to 'safe' behavior and requiring a slight acknowledgement for something dangerous).
echo > '"Reason for this Perl insanity?" || rm -rf .. |'
|