I'll admit that I don't understand your text description of what you are trying to accomplish. But, it seems from your code that you don't really need an array-of-arrays data structure; a simple array will suffice. Your two "for" loops just seem to flatten your AoA structure, so you might as well just use a simple array:
my @allDACDirs = (@configapp1, @configbbb); for my $i (0 .. $#allDACDirs) { ...
Or maybe I'm not good at following depth in multi-dimensional arrays.
Data::Dumper is a handy tool for understanding Perl data structures.

On a side note, you could save a little typing on your array constructors using qw:

my @configbbb = qw( m:configbbb f:b1.0 f:bb1.0.config );

Update: Here is a crack at a more complex data structure and how you would navigate it:

use strict; use warnings; use Data::Dumper; my @allDACDirs = ( { dir => 'conf', root => 'configapp1', files => [ {subdir => 'conf', name => '4K_logging.properties'}, {subdir => 'conf', name => 'logging.properties' }, {name => 'dactest1'}, ] }, { root => 'configbbb', files => [ {name => 'b1.0'}, {name => 'bb1.0.config'}, ] } ); #print Dumper(\@allDACDirs); # for debug for my $href (@allDACDirs) { my %h = %$href; my $curr_dir = "$location/$h{root}"; # mkdir curr_dir... if (exists $h{dir}) { # mkdir curr_dir/$h{dir}... } for my $ref (@{ $h{files} }) { if (exists ${$ref}{subdir}) { # mkdir subdir... # create file... } else { # create file... } } }

In reply to Re: How would you handle arrays of arrays? by toolic
in thread How would you handle arrays of arrays? by gokuraku

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.