fix bugs in wc command perl