<?xml version="1.0" encoding="windows-1252"?>
<node id="959097" title="Re^2: can't import using exporter" created="2012-03-12 05:31:24" updated="2012-03-12 05:31:24">
<type id="11">
note</type>
<author id="757127">
tobyink</author>
<data>
<field name="doctext">
&lt;p&gt;But "use" requires the package to be defined in an appropriately named separate file. If the Debug package is defined in the same file as Transcode_plug, then it needs to be &lt;c&gt;import&lt;/c&gt;.&lt;/p&gt;
&lt;p&gt;It might be a good idea to do the &lt;c&gt;import&lt;/c&gt; in a &lt;c&gt;BEGIN&lt;/c&gt; block though, to ensure it happens at the same stage that &lt;c&gt;use&lt;/c&gt; would have done it.&lt;/p&gt;
&lt;p&gt;The other alternative (as discussed in another thread recently) would be for the Debug package to include the following line:&lt;/p&gt;
&lt;code&gt;BEGIN { $INC{+__PACKAGE__}=__FILE__ }&lt;/code&gt;
&lt;p&gt;This will allow Transcode_plug to &lt;c&gt;use Debug&lt;/c&gt; even though Debug isn't defined in a separate file.&lt;/p&gt;
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-757127"&gt;&lt;small&gt;&lt;small&gt;
&lt;tt&gt;perl -E'sub Monkey::do{say$_,for@_,do{($monkey=&amp;#x5B;caller(0)]-&gt;&amp;#x5B;3])=~s{::}{ }and$monkey}}"Monkey say"-&gt;Monkey::do'
&lt;/tt&gt;&lt;/small&gt;&lt;/small&gt;&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
959066</field>
<field name="parent_node">
959073</field>
</data>
</node>
