R. Joseph Newton said:

>> And that finally explains why in some of my scripts using the
>> Win32::Lanman
>> module I have to do a 'require Win32;' instead of a 'use Win32' if I
>> don't
>> want to get warning messages about conflicting constants.
>
> I*t sems to me that this is sort of a shortcoming, if you have to worry
> about that at all.  In C/C++, one of the standards for writing any header
> file is to always surround the entirety with an inclusion guard to prevent
> the precompiler from redefining classes or redeclarating other constants
> and prototypes.  Usually it took the form of:
>
> #ifndef STDIO_H
> #define STDIO_H
> ... All code in header
> ...
> #endif   /* STDIO_H */
>
> Which effectively prevents such problems--although it does not prevent
> deadlock from circular includes.
>
> I assume that most Perl modules have similar structures built in.

No.  This is taken care of by perl itself using %INC.  The module author
does not need to do anything to stop the module being included more than
once.

It sounds like something is broken in the Win32 import sub (I have never
used or looked at Win32.pm), or that there is some other problem, but
import guards are not the solution.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to