D
dave
I have trouble initializing the following multidimensional array
my @Table = ( [],[],[],[] );
push (@Table [ 't1', 't2', 't3', 't4' ] ) ;
push (@Table [ 'x1', 'x2', 'x3', 'x4' ] ); # and so on
foreach my $next (@Table)
{
if ( @$next[0] eq 'xx' )
{
# do something
}
}
When I run the foreach loop, the first 4 times will have "Use of
uninitialized value" error and then everything will be fine.
How can in initialize @Table so that the first entry should have 't1'
't2' .. .in it.
Thanks
David
my @Table = ( [],[],[],[] );
push (@Table [ 't1', 't2', 't3', 't4' ] ) ;
push (@Table [ 'x1', 'x2', 'x3', 'x4' ] ); # and so on
foreach my $next (@Table)
{
if ( @$next[0] eq 'xx' )
{
# do something
}
}
When I run the foreach loop, the first 4 times will have "Use of
uninitialized value" error and then everything will be fine.
How can in initialize @Table so that the first entry should have 't1'
't2' .. .in it.
Thanks
David