First off, I'd like to say thanks to everyone who has contributed to this thread. You've all helped me immensely--either by code examples or by giving me perspective on my problem.

I think I've run into a problem that may require me to rethink the process by which I grab these values. It turns out that some of the hashes in %some_hash have different numbers of elements. So it looks something like:

%some_hash = ( 'NEW_YORK' => { 'capital' => 'Albany', 'colors' => 'red, white, blue', 'bird' => 'pigeon' }, 'MASSACHUSETTS' => { 'capital' => 'Springfield', 'colors' => 'green, yellow', } # etc );

This is forcing me to rethink the entire process, and will probably mean that we break %some_hash out into its own file (as some of you suggested). Also my colleague just told me that the utility of what I'm doing (this is a pet project) is somewhat limited for other reasons related to the function of the original script.

But that doesn't temper my gratitude for the attention I've recieved. Thank you Monks. I learned a lot here.

AH


In reply to Re: Re: sorting a hash that's in another file by alienhuman
in thread sorting a hash that's in another file 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.