$arr= [ [1,2,3,4,5,6,7,8,9 ], #works as expected [1,2,3,'',5,6,7,'',9 ], #works as expected [1,2,3, ,5,6,7, ,9 ], #does not work as expected "empty fields " + are ignored ]; my $dd=Data::Dumper->new([$arr],[ qw(arr) ] )->Indent(1)->Quotekeys(0) +->Dump; print $dd; $arr = [ [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], [ 1, 2, 3, '', 5, 6, 7, '', 9 ], [ 1, 2, 3, 5, 6, 7, 9 ] ];
as you can see from the dump in the last record there are less fields then I mentioned in the definition of $arr. When I quote the "emty fields" everything is OK. however when I just use a sequence of , , or ,, the index of the array is not updated. Hence the less fields in the last record. Should expect that all records have the same number of indexes, which is not the case.
Is there a way that the "empty fields" , as i call them can be initialized to undef. In my opinion this should be the case.
Thanks in advance Greeting ,In reply to Re: Perl reference array
by teun-arno
in thread Perl reference array
by teun-arno
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |