in reply to Eliminating Duplicate Lines From A CSV File

The code as you have written, does not have balanced { braces }, so I can't see how far you got. Nor is it indented in a way that makes clear what loop the continue statement belongs to. Trying to fix it, I have some comments: Better than
my ($server, @data) = (split(“,”,$line));
would be
my ($server, $data) = (split(“,”,$line));
or even better would be
my ($server, $data) = split ',', $line, 2;
Actually this last addition of the 2 argument doesn't make too much difference since perl already optimizes this, and stops without parsing the whole line. Note also that none of the parentheses were needed on the right hand side.

Now with a simple scalar data, it is easier to fix the code that you have to skip the first line, so instead of

if ($data[0] lt “!” ) { $data[0] = 0; } next if grep /[^0-9.]/, @data;
you could try
next if $data =~ /[^0-9.]/;
Furthermore, you did a clever
push @{$usage{$server}}, 0 while @{$usage{$server}} < $files; push @{$usage{$server}}, $data[0];
But perl already autoextends arrays, so you can simply write
$usage{$server}->[$files] = $data unless $usage{$server}->[$files]
This will leave all the previous zeros as missing, which you can deal with at the end more easily. BTW, your code will fill in missing zeros, if the are followed by data in later files, but if the missing zeros were in the third file, the arrays would not receive the zeros using your code.

At the end you have

continue { $files++ if eof; } close $fh or die "Can’t close file $file: $!";
What is the point? Why not a clean
my $files = 0; for my $file ("sfull1ns.dat","sfull2ns.dat","sfull3ns.dat") { open (my $fh,'<',$file) or die "Can’t open file $file: $!"; while (my $line = <$fh>) { ... } $files++ close $fh or die "Can’t close file $file: $!"; }

And you have no provision for output, obviously you need a final line after the whole looping is done which does

print "$_," . (join ',', @{$usage{$_}}) . "\n" for (keys %usage);

This will of course complain about uninitialized values in the array, but will run. Instead of zeros, the missing values will be missing, but we are nearly there. So now is the time to fix that by putting this code just before the printout.

for (keys %usage) { for my $f (0,1,2) { $usage{$_}->[$f] = 0 unless defined $usage{$_}->[$f]; } }
You may argue that your solution was better, keeping this inside the main loop. It did take less code. But it was confusing in the middle of other processing. Here, to separate it out, in my mind makes cleaner code.

I have not put it all together for you, so that you can understand each piece as you implement it, but it did work for me.