Oh yes I did. I always try my script on the command line to ensure the
syntax are ok before running them on the web server with mod_perl. So
the error has to do with mod_perl. Perhaps you may want to take a look
of some examples:
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. I’ll appreciate any help.
Below is 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>); # Here is line 42
}
print qq(</tr>);
}
print qq(<tr><td colspan=$columnspan
bgcolor='#d0d0d0'> </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==================
Babs
-----Ursprüngliche Nachricht-----
Von: Sreeji K Das [mailto:[EMAIL PROTECTED]
Gesendet: Samstag, 23. August 2003 11:10
An: B. Fongo; 'Perrin Harkins'; [EMAIL PROTECTED]
Betreff: Re: AW: Use of uninitialized valued in concatenation....
Did u check what's in line # 42 ? If u run the same
script with same params as stand-alone, do u see the
warning ?
Sreeji
--- "B. Fongo" <[EMAIL PROTECTED]> wrote: > It is not a
standard perl error message. I went
> through mod_perl doc at
>
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#T
> racing_Warnings_Reports
>
> and understand that, the error message appear if one
> fails to pass a
> value to a subroutine before using. Looking through
> my codes, you may
> have noticed that, I did pass 2 arguments to the
> subroutine.
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Perrin Harkins [mailto:[EMAIL PROTECTED]
> Gesendet: Samstag, 23. August 2003 00:10
> An: B. Fongo
> Cc: [EMAIL PROTECTED]
> Betreff: Re: Use of uninitialized valued in
> concatenation....
>
> On Fri, 2003-08-22 at 17:23, B. Fongo wrote:
> > 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”.
>
> This is a standard perl error message. It is not
> related to mod_perl.
> You can look in the perldiag man page for a more
> complete explanation.
>
> - Perrin
________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html