chomp @voltages; for my $count ( ... ) { ...