K
ktom
i have created an array that is sparse, ie there are a number of
elements which are undefined, because i have used a numeric index to the
array and not all of the intermediate indices get used.
here is the code to print this array, which doesn't work...
print Dumper( @ca ) ;
foreach my $item ( @ca ) {
if( defined ref $ca[$item] ) {
print "chain $item has $ca[$item] exceptions\n";
}
}
here is a snippet of the output..
$VAR1 = 6;
$VAR2 = undef;
$VAR3 = undef;
$VAR4 = 5;
$VAR5 = undef;
$VAR6 = 88;
$VAR7 = 1;
chain 6 has 1 exceptions
Use of uninitialized value in array element at ./findViolInScanPath.pl
line 51, <IFILE> line 100.
it seems the autovivification process is biting me, but i don't know how
to work around it. am i making harder than it needs to be.
thanks.
kevin
elements which are undefined, because i have used a numeric index to the
array and not all of the intermediate indices get used.
here is the code to print this array, which doesn't work...
print Dumper( @ca ) ;
foreach my $item ( @ca ) {
if( defined ref $ca[$item] ) {
print "chain $item has $ca[$item] exceptions\n";
}
}
here is a snippet of the output..
$VAR1 = 6;
$VAR2 = undef;
$VAR3 = undef;
$VAR4 = 5;
$VAR5 = undef;
$VAR6 = 88;
$VAR7 = 1;
chain 6 has 1 exceptions
Use of uninitialized value in array element at ./findViolInScanPath.pl
line 51, <IFILE> line 100.
it seems the autovivification process is biting me, but i don't know how
to work around it. am i making harder than it needs to be.
thanks.
kevin