in reply to Odd number of elements error

Could it be you are doing something the equivalent of:

use strict; use warnings; my $valuesLine = <DATA>; my @values = split /\s+/, $valuesLine; my %data = @values; __DATA__ one two three four five

where instead you should initialize %data using something like:

my %data = map {$_ => 0} @values;

DWIM is Perl's answer to Gödel