develooper Front page | perl.beginners | Postings from January 2012

supressing error message Use of uninitialized value in concatenation....

Thread Next
From:
Rajeev Prasad
Date:
January 9, 2012 10:53
Subject:
supressing error message Use of uninitialized value in concatenation....
Message ID:
1326135202.63385.YahooMailNeo@web114220.mail.gq1.yahoo.com
Hello,

I have a lot of fields being concatenated to form a string and sometimes the values are empty, so i am getting this error:

Use of uninitialized value in concatenation (.) or string at ./script.pl line 144, <$IN_FH> line 1.

how can i suppress this?

my logic flow:


$string1 = "a,b,c,d,e,f,........ a very long record"

i only want few fields from this record of hundreds of fields, so

@array = split(/,/,$string1)

then reassemble the array elements into the new string:

$string2 = $array[3]." ".$array[7]." ".$array[24].... and so on....

so whenever anything like $array[24] is empty and it occurs in concatenation above i get this error:

Use of uninitialized value in concatenation (.) or string at ./script.pl line 144, <$IN_FH> line 1.

how to suppress or avoid this error?

ty.
R


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About