in reply to Remove the first word for each lines from a text file
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Remove the first word for each lines from a text file
by Anonymous Monk on Dec 22, 2016 at 21:41 UTC | |
by ExReg (Priest) on Dec 22, 2016 at 21:58 UTC |