http://qs321.pair.com?node_id=571935

Yoda_Oz has asked for the wisdom of the Perl Monks concerning the following question:

i dont't know where im going wrong. can sombody please tell me what this means?
Missing $ on loop variable at measurements2.pl line 69.
here is my code...
#!/usr/local/bin/perl use strict; use warnings; my $path='CustData.txt'; my @range = ("10-20", "20-30", "30-40", "41-50", "51-60", "61-70", "71 +-80","81-90", "91-99"); my @count; my @percent; my %HoH; open(DATA, "<$path") || die "Couldn't open $path for reading: $!\n"; my $output; open my $fd, '>', \$output or die "open: $!"; while (<DATA>) { chomp; my ($id, $title, $surname, $forename, $sex, $dob, $vision) = split +(/,/); $HoH{$id} = {'title' => $title, 'surname' => $surname, 'forename' +=> $forename, 'sex' => $sex, 'dob' => $dob, 'vision' => $vision,}; } close(DATA); my $range1=1; my $range2=10; my $range3=1; my $range4=10; my $person_count=0; sub personCount { my ($x,$y) = @_; my ($vision_total,$person_count)=0; foreach my $id (sort keys %HoH) { if( ($HoH{$id}->{'vision'}>=$x) & ($HoH{$id}->{'vision'}<=$y) +) { ++$person_count; $vision_total=$vision_total+$HoH{$id}->{'vision'}; } } return int($person_count); } sub percent { my ($x,$y) = @_; my $percent = 0; my ($total_person_count,$vision_total,$person_count)=0; foreach my $id (sort keys %HoH) { ++$total_person_count; } foreach my $id (sort keys %HoH) { if( ($HoH{$id}->{'vision'}>=$x) & ($HoH{$id}->{'vision'}<=$y) +) { ++$person_count; $vision_total=$vision_total+$HoH{$id}->{'vision'}; } } return $percent = ($person_count/$total_person_count)*100; } print $fd ("Range\t"); foreach (@range) { printf $fd ("%7s", $_); } print $fd ("\n"); for my ($counter=0;$counter<9;$counter++) { $range3=$range3+10; $range4=$range4+10; my $personCount = personCount($range3,$range4); push (@count, $personCount); } print $fd ("Count\t"); foreach (@count) { printf $fd ("%7s", $_); } print $fd ("\n"); for my ($counter=0;$counter<9;$counter++) { $range1=$range1+10; $range2=$range2+10; my $percent = sprintf("%.0f", percent($range1,$range2)); push (@percent, $percent); } print $fd ("Percent\t"); foreach (@percent) { printf $fd ("%7s", $_); } print $fd ("\n"); print $fd ("\n"); close $fd;