perl -i -e 'truncate <>,0; print "HELLO";' mytest