<?xml version="1.0" encoding="windows-1252"?>
<node id="953273" title="Re: Accessing hash from within module" created="2012-02-11 21:07:58" updated="2012-02-11 21:07:58">
<type id="11">
note</type>
<author id="190859">
bart</author>
<data>
<field name="doctext">
You might think of [import]ing the variable into your main package, if it is defined in a module.

&lt;p&gt;That's actually do the same thing as [Jenda]'s code snippets, but it looks just a bit less hacky. See [mod://Exporter] for one way to implement it.

&lt;p&gt;You could also think of declaring the global variables in a dedicated module and use it in any module that requires access to them.

&lt;p&gt;Also note that you can use "&lt;c&gt;::&lt;/c&gt;" as short for "&lt;c&gt;main::&lt;/c&gt;". So you could just spell it as &lt;c&gt;%::lglobal&lt;/c&gt; (and &lt;c&gt;$::lglobal{$key}&lt;/c&gt;), which doesn't look to bad to me. You could event think of the "&lt;c&gt;::&lt;/c&gt;" prefix as hungarian notation, so it could even work out for the better.
</field>
<field name="root_node">
953265</field>
<field name="parent_node">
953265</field>
</data>
</node>
