|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Re^5: cut vs split (suggestions)by pijll (Beadle) |
| on Apr 17, 2005 at 03:54 UTC ( [id://448604]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
You are using both the -n switch and <> in the first line! This means you lose half of your lines...
Anyway: -n does an unnecessary chomp on every line, so remove that; and use a limit on split: it doesn't actually need to split all 25 fields: Update: But for<> reads all lines in at ones; you may not want that with large files, so use while <> instead.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||