How do I know which constants these two modules export?

--
Andy Pastuszak
Desktop Engineer II
Commerce Bank
[EMAIL PROTECTED]
(856)470-3270




Robert May <[EMAIL PROTECTED]>
05/05/2006 03:42 PM

 
        To:     Andrew M Pastuszak <[EMAIL PROTECTED]>
        cc:     perl-win32-gui-users@lists.sourceforge.net
        Subject:        Re: [win32-gui] RE: [perl-win32-gui-users] Odd problem 
with compiling a 
script


Andrew M Pastuszak wrote:

[edited]

 > My script used to read as follows:
 >
 > use strict;
 > use warnings;
 > use Win32;
 > use Win32::GUI;   <- line 12

 > I get the following error:
 >
 > Subroutine main::MB_ICONEXCLAMATION redefined at
 > C:/Perl/lib/Exporter.pm line 65. at I:\SiteBuild HTA
 > files\SiteBuild HTA files\policymod2.pl line 12
[snip]

 > I simply changed it to:
 >
 > use Win32::GUI;
 > use strict;
 > use warnings;
 > use Win32;
 >
 > and my problem seems to have resolved itself.

I can duplicate the problem and the solution.  I don't understand why 
the presented solution solves the problem.

Both Win32 and Win32::GUI export a set of constants by default (this, by 
the way, will change if a future Win32::GUI release), and some of the 
constants are the same.  I would expect to get those warnings (and they 
are warnings, not errors) whichever way round you put the use statements.

A better way to fix the problem is to get the 2 modules to
only export the constants that you really want, by listing them in the 
use statement.  For example, if you're not using any of the exported 
constants, turn them off:

   use strict;
   use warnings;
   use Win32();
   use Win32::GUI();

Regards,
Rob.





____________________________
This message and any attachments may contain confidential or privileged 
information and are intended only for the use of the intended recipients of 
this message.  If you are not the intended recipient of this message, please 
notify the sender by return email, and delete this and all copies of this 
message and any attachments from your system.  Any unauthorized disclosure, 
use, distribution, or reproduction of this message or any attachments is 
prohibited and may be unlawful.
____________________________

Reply via email to