Could one of the esteemed monks who delves into arcane behaviour please assist me.
I have a snippet of code:
print STDERR "$rec->[IMP_WG] $rec->[CSC_HAN]\n"; if ( defined( $rec->[IMP_WG] ) && $rec->[IMP_WG] ne '' && defined( $rec->[CSC_HAN] ) && $rec->[CSC_HAN] eq '1' ) { print "$rec->[CLASSIF] $rec->[IMP_WG] $rec->[SRV_PLT]\n"; }
That produces (in part) the following output (greenfox you can look away now):
CSC.MIDRANGE.SERVER.SUPPORT 1 CSC.MIDRANGE.SERVER.SUPPORT 1 CSC.MIDRANGE.SERVER.SUPPORT 1 Use of uninitialized value at stats2 line 190. CSC.NETWORK.ENG 1 Use of uninitialized value at stats2 line 190. 0 CSC.MIDRANGE.SERVER.SUPPORT 1 Use of uninitialized value at stats2 line 190. 0 CSC.NT.SERVER.SUPPORT 1 Use of uninitialized value at stats2 line 190.
Line 190 is the 'if' statement in the listed code.
The input data is the result of a split operation and it is possible that the indexes IMP_WG and CSC_HAN could contain undef values.
This is perl, version 5.005_03 built for sun4-solaris.
use strict; and -w are in use.
Any suggestions about what I am missing?
20040108 Edit by jeffa: Changed title from 'I dont understand why Perl is complaining.'
In reply to split, Use of uninitialized value by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |