Title: Use of uninitialized valued in concatenation....

Hello

I have a file (output_tab.pm) that I use to generate tables dynamically. Even though it serves its purpose, it goes on generating this error:

“Script_name.pl: Use of uninitialized value in concatenation (.) or string at output_tab.pm line 42”.

I went through this section of mod_perl docs und  thought I’ve understood it, but I can’t feature out the error.

Below it my module and a script that triggers such error.

#################################################################

 output_tab.pm

################################################################

#---------------------------------------------------------------------

# Modulname: output_tab.pm

#---------------------------------------------------------------------

use strict;

package output_tab;

use vars qw(@ISA @EXPORT);

require Exporter;

@ISA = qw(Exporter);

@EXPORT = qw(output_tab);

use db_Verbindungen;




sub output_tab{

  

   my ($dbh,$abfrage,$columnspan, $sth,@table_head,@table_data);

   ($abfrage, @table_head) = @_;

   $columnspan = @table_head;

   print qq(<table width="95%" border="1" cellspacing="1" cellpadding="1" align="center">);

   print qq(<tr bgcolor="#a9a9a9">);

   foreach (@table_head){

      print qq(<th>$_</th>);

   }

   print qq(</tr>);

   # Erbnisse Anzeigen

   $dbh = db_Verbindungen;

   $sth = $dbh->prepare($abfrage);

   $sth->execute();

   print qq(<tr>);

   while(@table_data = $sth->fetchrow_array){

      #my $table_data;

      foreach (@table_data)

      {

          

           print qq(<td bgcolor='#d0d0d0'>$_</td>);

      }

   print qq(</tr>);

  }

  print qq(<tr><td colspan=$columnspan bgcolor='#d0d0d0'>&nbsp;</td></tr>);

  print qq(</table>);

  $sth->finish();

  $dbh->disconnect();  

}

1;

  

  #######################################################################

########################################################################

#!/usr/bin/perl -w

#====================================================

#Script: pakete_auflisten.pl

#=====================================================

use strict;

use db_Verbindungen;

use gui;

use output_tab;


my ($dbh,$abfrage,@table_head);

$abfrage = ('SELECT Gruppe, Paketname, Auftragsdatum, Status, Statusmeldung FROM Gruppen_Software ORDER BY Auftragsdatum DESC');

@table_head = qw(Gruppe Paketname Auftragsdatum Status Statusmeldung);

# Aufruf der Methode top() des gui.pm Moduls.

top('Paketliste');

# At this stage i call the method output_tab with two arguements.

output_tab($abfrage,@table_head);

# Aufruf der Methode footer() des gui.pm Moduls.

footer();


#========== ENDE==================


I’ll appreciate any help.

Babs

Reply via email to