in reply to -F and trailing empty fields
I lose the trailing empty fields. But, removing the '-l' option returns them:perl -F, -lane 'print join("!",@F)' test.txt
Does anyone understand why this is happening? According to the command line help and perldoc -l without a parameter enables line ending processing, chomping the input line and setting $\ (output separator) equal to $/ (input separator). Why would that cause the -F splitting to drop the empty, trailing characters?perl -F, -ane 'print join("!",@F)' test.txt
---
s;;:<).>|\;\;_>?\\^0<|=!]=,|{\$/.'>|<?.|/"&?=#!>%\$|#/\$%{};;y;,'} -/:-@[-`{-};,'}`-{/" -;;s;;$_;see;
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: -F and trailing empty fields
by tuxz0r (Pilgrim) on Apr 30, 2008 at 18:06 UTC |