You've already got the right answer(s) for how to pull the hash into your script. But after a recent Perl Mongers meeting, I thought it worth mentioning the following:

If you're using that hash to handle configuration information, you may find it useful (and more powerful) to use tilly's new Template::ExpandHash module. This will not be a drop-in solution for your existing strategy, but rather, a new way of looking at using hashes for configuration data. It's a well thought out module. His presentation to LAPM was really interesting. The slide presentation can be found here: http://elem.com/~btilly/template-hashexpand/#title-slide.


Dave


In reply to Re: Trying to access hash from external perl file by davido
in thread Trying to access hash from external perl file by ruhroh

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.