perl -pi.bak -e "print qq(this is a test\n) if ($.==1);" data.txt
All I did was look at perldoc:perlrun. I seem to remember something else about prepending stuff to a file somewhere on perl monks. It can't be that easy can it?
Comment on Re: How would I do an inplace edit, prepending