Hi Masters,

I'm stuck at a code that gives ERROR! I'm not able to figure out why these error is reported. To my understanding I'm defining a local variable and assigning hash table values to my locally defined variable. Then I'm trying to print by adding these local variable to pre-defined array elements (DIN_SETUP_RISE[0] .... ). Please help me!!! Thanks.

Use of uninitialized value in concatenation (.) or string at gen_lib.p +l line 571 (#1) (W uninitialized) An undefined value was used as if it were alread +y defined. It was interpreted as a "" or a 0, but maybe it was a mi +stake. To suppress this warning assign a defined value to your variables. To help you figure out what was undefined, perl tells you what ope +ration you used the undefined value in. Note, however, that perl optimiz +es your program and the operation displayed in the warning may not necessa +rily appear literally in your program. For example, "that $foo" is usually optimized into "that " . $foo, and the warning will refer +to the concatenation (.) operator, even though there is no . in your program. Use of uninitialized value in concatenation (.) or string at gen_lib.p +l line 572 (#1) Use of uninitialized value in concatenation (.) or string at gen_lib.p +l line 573 (#1) Use of uninitialized value in concatenation (.) or string at gen_lib.p +l line 574 (#1)

Program were error occurs

foreach my $key (sort keys %hash) { #Assign $inc with hash value my $inc1 = @{$hash{$key}}[1]; my $inc2 = @{$hash{$key}}[2]; my $inc3 = @{$hash{$key}}[3]; my $inc4 = @{$hash{$key}}[4]; my $inc5 = @{$hash{$key}}[5]; my $inc6 = @{$hash{$key}}[6]; my $inc7 = @{$hash{$key}}[7]; my $inc8 = @{$hash{$key}}[8]; my $inc9 = @{$hash{$key}}[9]; my $inc10 = @{$hash{$key}}[10]; my $inc11 = @{$hash{$key}}[11]; my $inc12 = @{$hash{$key}}[12]; # Does current hash key value equal C_CLK_and_SCANCLK_L__I +N if ( @{$hash{$key}}[0] eq "C_CLK_and_SCANCLK_L__IN" ) { $count_C_CLK_and_SCANCLK_L__IN++; print $outfile1 "\"$DIN_SETUP_RISE_1[0] + $inc3, ",", +$DIN_SETUP_RISE_1[1] + $inc3, ",", $DIN_SETUP_RISE_1[2] + $inc3, \", +\n"; print $outfile1 "\"$DIN_SETUP_RISE_2[0] + $inc3, ",", +$DIN_SETUP_RISE_2[1] + $inc3, ",", $DIN_SETUP_RISE_2[2] + $inc3, \", +\n"; print $outfile1 "\"$DIN_SETUP_RISE_3[0] + $inc3, ",", +$DIN_SETUP_RISE_3[1] + $inc3, ",", $DIN_SETUP_RISE_3[2] + $inc3, \", +\n"; } }

Hash Table

$VAR1 = { 'KEY_NAME1' => [ 'VALUE1', '0.150', '0.900', '', '', '', '', '0.150', '0.900' ], 'KEY_NAME2' => [ 'VALUE2', '', '', '0.500', '0.500', '0.500', '0.500', '', '', '0.500', '0.500', '0.500', '0.500' ], };

In reply to Perl ERROR for uninitiated value or string by waytoperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.