Expanding on what Corion said, you second while loop is what is causing the problem. Instead of
print $out $_ while s/^\s*\S+\s*//;
get rid of the inner while:
s/^\s*\S+\s*//; print $out;
In reply to Re: Remove the first word for each lines from a text file
by ExReg
in thread Remove the first word for each lines from a text file
by ArifS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |