perl -E"$s=-s $ARGV[ 0 ]; truncate( $ARGV[0], $s-2 ) or die $!" junk.dat