in reply to perl functionality like unix's "sort -u" and "uniq -c"
I've not used File::Sort, but lets assume it sorts the file... I'd do something like
Code is untested and not well formated, but hopefully you'll get the idea.open(FILE, "sorted.file"); while (<FILE>) { if($_ != $previous) { print $current; $count++; } $previous = $_; } print "There are $count unique records";
|
|---|