perl uninitialized value in concatenation

 
Post new topic   Reply to topic    Aprelium Forum Index -> Perl
View previous topic :: View next topic  
Author Message
dapiaoen
-


Joined: 28 Dec 2006
Posts: 12

PostPosted: Mon Feb 05, 2007 4:53 pm    Post subject: perl uninitialized value in concatenation Reply with quote

I'm loading a hash with data from a SQL query. I'm compiling with use strict a the flag, -w and I get no errors.

However, the abyss CGI.log is full of:
Use of uninitialized value in concatenation (.) or string at AdmLib.pm line 64.
Use of uninitialized value in concatenation (.) or string at AdmLib.pm line 70.
Use of uninitialized value in concatenation (.) or string at AdmLib.pm line 71.
Use of uninitialized value in concatenation (.) or string at AdmLib.pm line 56.
Use of uninitialized value in concatenation (.) or string at AdmLib.pm line 64.
Use of uninitialized value in concatenation (.) or string at AdmLib.pm line 70.

Here's the code snippet

my %hshTblData = ();
my @row = [];
# cut....
while (@row = $sth->fetchrow_array()) {
$hshTblData{'tid'} .= "$row[0],";
$hshTblData{'rcd_sid'} .= "$row[1],";
$hshTblData{'rcd_date_time'} .= "$row[2],";
$hshTblData{'tbl_name'} .= "$row[3],";
$hshTblData{'fld_name'} .= "$row[4],";
$hshTblData{'fld_type'} .= "$row[5],";
$hshTblData{'fld_size'} .= "$row[6],";

Also, this code:
my $iIdx = 0;
my $iColCount = 0;
# ....cut....
@arrSglDisplay = split( ',', $hshFormData{'sgl_displayed'});
>>>>> if ( $iColCount == 0 && $arrSglDisplay[ $iIdx] > 0) {

Gets this error:
>>> Use of uninitialized value in numeric gt (>) at AdmInterfaces.pl line 248.

It is obviously a numeric value being compared so why the cgi.log error

Again, I get no compile errors (ActivePerl 5.8.8)

Thanks,

Chris
_________________
Chris F
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Feb 07, 2007 11:25 pm    Post subject: Re: perl uninitialized value in concatenation Reply with quote

dapiaoen,

It's not a compilation error but a runtime error (Perl reports it when executing the code and cannot report it when compiling only). So you'll have to check your code to understand why in the context of the execution, the error happens (actually using the form $variable[index] without having assigned it a value before that causes such an error).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Perl All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group