<?xml version="1.0" encoding="windows-1252"?>
<node id="918110" title="Re^2: including modules during runtime and dealing with OS specific (constants) code block" created="2011-08-02 13:26:32" updated="2011-08-02 13:26:32">
<type id="11">
note</type>
<author id="901898">
armstd</author>
<data>
<field name="doctext">
&lt;blockquote&gt;
First, the functions, SetAttributes and GetAttributes, must be specifically requested:
&lt;code&gt;
use Win32::File qw(:DEFAULT SetAttributes GetAttributes); 
&lt;/code&gt;
&lt;/blockquote&gt;
&lt;p&gt;That would not actually make any difference here.  The only difference it would make is allowing this syntax:
&lt;/p&gt;
&lt;code&gt;
GetAttributes()
&lt;/code&gt;
&lt;p&gt;Instead of this:
&lt;/p&gt;
&lt;code&gt;
Win32::File::GetAttributes()
&lt;/code&gt;
&lt;p&gt;...which is not being attempted here.  That specification just tells import() what to bring into the current package namespace from the module.
&lt;/p&gt;
&lt;p&gt;The issue in play here is the 'eval', which gives the compiler no idea what will be available at runtime.  So it fails at compile time.  In your 'fixed' example, it's working not because of your added imports, its working because you removed the 'eval'.
&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-901898"&gt;
&lt;p&gt;
--Dave
&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
917920</field>
<field name="parent_node">
917969</field>
</data>
</node>
