Perl newbie help

Trying to get this perl script to work… its meant to read a directory of excel files and extract a certain row from all files…however when trying to run it on my linux box i get

“Global symbol “@data” requires explicit package name at line 56.”

can anyone help? im totally new to perl. thanks -

my $excel_directory = 'Invoices';
my $out_directory = 'out';
opendir(EXCELDIR, $excel_directory) || die ("no excel directory");
my @excelfiles = readdir(EXCELDIR);

       my $LPHname;    # String to hold Local Public Health Name.
       my @sheetarray; # Array to hold the row.
       my $sheetcount; # Array element in the row.
       my $sheetname; # Name of the Excel spreadsheet.
       my $sheettemp;  # Temporary string to hold row for join.
       my $cellnumber;  # Cell number in the row.
       my $cellwanted;  # Cell number in the row.
       my $rowwanted;  # Row number wanted.
       my $county_namecell;  # Cell for county name.
       my $county_namerow;  # Row for county name.
foreach my $exxfilename (@excelfiles){
    if ($exxfilename =~ /^\.+.*/) { next; }
    my $xls = Spreadsheet::ParseExcel::Simple->read($exxfilename);
    foreach my $sheet ($xls->sheets) {
       $sheetname= $sheet->{sheet}->{Name}; # Sheet Name

       if ($sheetname !~ 'Simple Invoice') { next; }
#       $cellwanted=1;

       while ($sheet->has_data) {
            my @data = $sheet->next_row;
         if ($sheetcount==$county_namerow){
            foreach my $ttcell (@data) {
                if ($cellnumber != $county_namecell ){next;};
#                 $sheetarray[$sheetcount]=join("	",$sheettemp,$ttcell);
          } # Get the name of the Local Health

#     if (($sheetcount < ($rowwanted-1)) || ($sheetcount > ($rowwanted+7))){next
            if ($sheetcount != $rowwanted){next;};
     $sheetarray[$sheetcount]=join("	",$sheettemp,$LPHname);
            foreach my $ttcell (@data) {
#                if ($cellnumber != $cellwanted ){next;};
                 $sheetarray[$sheetcount]=join("	",$sheettemp,$ttcell);
    foreach my $sheetline (@sheetarray){
        print $sheetline,"

#    foreach my $sheetline (@sheetarray){
#        print $sheetline,"
#    }