Okay.. I'm REALLY struggling to understand what's going on here - few others used similar syntax. I've tried running it through a debugger and I think that because there's SOOO much going on in individual lines, I'm missing a lot.

my $ref = \%database; $ref = $ref->{$_} //= {} for @$fields;
is puzzling. I tried to find info on //= and found only a clumping of similar nomenclature vaguely saying it transfers info into arrays. But couldn't look at intermediate values from what I think is a for loop built into the end of the end of the 2nd line. The $_ is familiar vaguely as a reference to a value within a for loop (for instance), but the $ref->{$_} part, along with the //= {} (empty set?) is throwing me as to what's happening here.

(try searching for "//=" and you get back a lot of nothing!! Yeesh... I was (somewhat) happy to have finally found the vague reference. It just didn't help me much. LOL

I'm admittedly struggling with references and dereferences, and how it's being used or addressed.

So looking at how %database gets filled isn't intuitively obvious for me. , nor the entire effort within combine and tail.

I'll study this some more. Have had to deal with my mother-in-law's recent stroke and husband ( both 90), and competing priorities in the job. It's hard to keep focused and dive slowly through this.

I did want to say thank you tybalt89!

In reply to Re^4: Building a dynamic array or some other method? by CAdood
in thread Building a dynamic array or some other method? by CAdood

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.