foreach my $sec_level(@list){ foreach (@$sec_level){ # $_ is now the element in the second level list } } #### XXXXX X XXXXX X XXXXX