foreach my $dacdir ( @allDACDirs ) { my $curr_dir; my $entry; # Read the array and populate foreach $entry (@{$dacdir}) ...