perl -i -ple 'truncate $1, 0; print q{hello}' ./testpl [download]
In reply to perl one-liner by mojobo