perl -i.bak -wpe '1 while s/[^\x08]\x08//' mylog.txt