in reply to -F and trailing empty fields
Related bit of behavior:
ben@Tyr:~$ printf "a,b,c,,,"|perl -F, -ane 'print 0+@F, "\n"' 3 ben@Tyr:~$ printf "a,b,c,,,\n"|perl -F, -ane 'print 0+@F, "\n"' 6
It does seem as though the autosplit takes that '\n' as some sort of a fencepost and counts the fields up to it if it exists, and chops them off otherwise.
-- Human history becomes more and more a race between education and catastrophe. -- HG Wells
|
|---|