open(INFO,"$score" ); # you need to check to see if this failed or not open(INFO,"$score" ) or die "failed to open $score\n"; open(INFO2,"$player" ) or die "failed to open $player\n"; @score = split(/[,]/,$_); # you have a useless character class and # split uses $_ if nothing is specified # this is not actually wrong it is just good style @score = split(/,/); # but the split is not working on the file # you think it is. # This is splitting $_ from INFO2 which is the player file. # It looks like you want the score file. # This confusion most likely brought on by your # inconsistant indentation style if ($total[$index] == $score[0]) # You never increment $index. it's always 0 $total++; # I think you meant $index but you created a # new var called $total and incremented it