Perl Monk, Perl Meditation | |
PerlMonks |
Re: At each change in...by Abigail-II (Bishop) |
on Jun 13, 2002 at 09:55 UTC ( [id://174134]=note: print w/replies, xml ) | Need Help?? |
Well, if you are on a Unix system, make use of its toolkit.
One of the tools is called sort and usually has options
to "merge, do not sort" and "uniques only". On my system, you
these options are enable with -mu, but check your manual page.
Then, instead of opening your file with:
open it with:
No counter needed, no check, no keeping track of the previous. Ultimate code reuse. Abigail
In Section
Seekers of Perl Wisdom
|
|