On Tue, May 4, 2010 at 8:39 PM, iinfer <tbon...@gmail.com> wrote: > # OPEN THE KEY > > my @key=(); > my @score_key=(); > sub key{ > my $inFile = 'key.csv'; > open(IN, $inFile) or die "open $inFile: $!"; > @key=split(',',<IN>); > @score_key=shift(@key); > return @key; > } >
Is it possible that the last value is "C\n" instead of just "C"? You might try this code... sub key{ my $inFile = 'key.csv'; open(IN, $inFile) or die "open $inFile: $!"; my $line = <IN>; chomp $line; @key=split(',',$line); @score_key=shift(@key); return @key; } See http://perldoc.perl.org/functions/chomp.html for more information about "chomp". -- Robert Wohlfarth