It looks like something like this (removed the checks):
my $number_of_mains = 0; my $number_of_subs = 0; foreach my $main (sort(uniq(@mains_paths))) { my (@list_of_dirs,@subs_data); my $main_path = abs_path($main); find( sub { get_valid_dirs( \@list_of_dirs, $_ ) }, $main_path); my $main_name = basename($main_path); my %main_block = ( $ALL_DATA_NAME => $main_name, $ALL_DATA_PATH => $main_path ); $number_of_mains++; foreach my $dir (sort(@list_of_dirs)) { my ($sub_path,$sub_name,$relative_sub_path,$paths_all,$results +_all,@results_data,%sub_block); $sub_path = dirname($dir); $sub_name = basename($sub_path); $relative_sub_path = File::Spec->abs2rel($sub_path,$main_path) +; %sub_block = ( $SUB_NAME => $sub_name, $SUB_PATH => $relative_sub_path, ); $results_all = $dir."/".$DIR_NAME."/".$RESULTS_FILE_NAME; unless((-e $results_all) && (-s $results_all)) { next; } prase_file($results_all,\@results_data); $number_of_subs++; @{$sub_block{$RESULTS}} = @results_data; push(@subs_data,\%sub_block); } @{$main_block{$SUBS}} = @subs_data; push(@mains_data,\%main_block); } @{$all_mains{$MAIN}} = @mains_data; $all_mains{$REPORT_NAME} = $opt_href->{$REPORT_NAME}; $all_mains{$MAIN_COUNTER} = $number_of_mains + 0; $all_mains{$SUBS_COUNTER} = $number_of_subs + 0; $all_mains{$TIMESTAMP} = $start_time + 0;
I'm trying now to understand how to do the opposite thing.

In reply to Re^8: (OT) Perl and creating a query for MongoDB by ovedpo15
in thread (OT) Perl and creating a query for MongoDB by ovedpo15

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.