http://www.perlmonks.org?node_id=371573


in reply to Want to do One line Perl Command

If we make an assumption that any line that doesn't have a .c file is an error statement...

perl -lne '/\.c$/?$h{$l=$_}++:delete$h{$l}}{unlink keys%h' file.txt