jdporter,

Update: I should've keep reading in perlreftut! The answer is here for anyone else that is still learning how to use references. Thank you all for your help.


Thanks for the further elaboration. For some reason, I am having a hard time understanding what is happening here:

push @{$data{$query}}, $_;

From perlreftut:
"If $aref contains a reference to an array, then you can put {$aref} anywhere you would normally put the name of an array. For example, @{$aref} instead of @array."

However, in your/my code, $query is a list, %data is a hash... so why the @{} notation? What's going on there that I'm missing?

My second question is: all of the code I posted is happening in a subroutine... how do I return a reference to the HoA? Is it:

return \@{$data};

Slightly boggled,

AH

----------
Using perl 5.6.1 unless otherwise noted. Apache 1.3.27 unless otherwise noted. Redhat 7.1 unless otherwise noted.

In reply to Re: Re: Re: $_ and nested while loops w/angle operator by alienhuman
in thread $_ and nested while loops w/angle operator by alienhuman

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.