in reply to duplicate records in a csv file

Your $csv could use a ->new ({ binary => 1, auto_diag => 1 }) to catch errors better.

Uniqueifying arrays that keep the order can be done much easier. The perlfaq's give even more solutions:

tux$ cat test.pl #!/pro/bin/perl use strict; use warnings; my @data = (1, 3, 4, 5, 3, 6, 8, 4, 9); $" = ", "; print "(@data)\n"; { my %seen; @data = grep { !$seen{$_}++ } @data; } print "(@data)\n"; tux$ perl test.pl (1, 3, 4, 5, 3, 6, 8, 4, 9) (1, 3, 4, 5, 6, 8, 9)

Enjoy, Have FUN! H.Merijn