in reply to Re: editing files with (<>)
in thread editing files with (<>)

$_="" is different from s/.*// because the regexp keeps the line end ("\n" or CR or CRLF or LF)

$\=~s;s*.*;q^|D9JYJ^^qq^\//\\\///^;ex;print

Replies are listed 'Best First'.
Re^3: editing files with (<>)
by Aristotle (Chancellor) on Dec 21, 2004 at 09:43 UTC

    I skipped over that since I assumed $_ = "" is what he wanted — he is dropping those lines wholesale after all. I should have noted the fact that it was wrong…

    Makeshifts last the longest.