in reply to while loop, search & replace
The '1' being printed the return value of s///, which (in scalar context) is the number of substitutions performed (1, in this case). You're also unintentionally removing the word 'total'. Solution:
if(/^call started/){ s/^call.*total/Modem Line 0\/$i : total/; print OUT "$_\n"; $i++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: while loop, search & replace
by Anonymous Monk on Oct 01, 2004 at 18:42 UTC | |
by ikegami (Patriarch) on Oct 01, 2004 at 19:12 UTC |