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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |