in reply to How would I do an inplace edit, prepending '~foo' to every key of a hash? (was: How would I do an inplace edit, prepending)

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?