This is not turn key code, but hopefully it will provide some guidance.
Some problems:
I don't understand your pattern, it doesn't look perlish.
Certainly comment out test data generation.
There will be problems if input files have different sizes.
This uses my current favorite Path::Tiny but could be adopted to others.

#!/usr/bin/perl # http://perlmonks.org/?node_id=1198355 use strict; use warnings; use Path::Tiny; use Storable qw(nstore retrieve); my $column = 1; # these could be passed i +n... my $filepattern = qr/(thing.*).foo__bar_ar/; my $projectdirectory = './some'; # make test data path("$projectdirectory/$_")->mkpath for qw( one two/three ); nstore [[1.34, 2.53], [3.26, 4.001]], "$projectdirectory/one/thing1.fo +o__bar_ar"; nstore [[5.55, 6.911], [7.373, 8.808]], "$projectdirectory/two/three/thing3.foo__bar_ar"; # end make test data my @answer; my $header = 'Number'; path($projectdirectory)->visit( sub { my ($path) = @_; /$filepattern/ or return; $header .= ", $1"; my $arrayref = retrieve($path); my $number = 0; $answer[$number++] .= ", " . $_->[$column] for @$arrayref; }, { recurse => 1 } ); my $number = 1; $_ = $number++ . "$_\n" for @answer; print "$header\n", @answer;

In reply to Re: Consolidating nstore arrays by tybalt89
in thread Consolidating nstore arrays by Speed_Freak

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.