If I understand it correctly, "cp -a" is linux/gnu only -- bsd (including freebsd and macosx) don't have a "-a" option for "cp" (though other options in combination will give the same result).
Note that your usage (cp -a D[12]/* Dd/) will take the "depth 1" contents in ascii-betic order, and deeper contents in "arbitrary" (directory content) order, so in any case, file age doesn't enter into the logic.
If there might be path/name collisions among the source directories, where differences of age and content matter, you might look at "rsync" (for which you'll find perl modules on CPAN, in case that helps, but you'll probably need to grok the rsync command-line tool options anyway, so try "man rsync").