From: "Paul Johnson" <[EMAIL PROTECTED]>
> R. Joseph Newton said:
> > 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.

No there is nothing broken. The modules ARE compiled just once (and 
you are right it's thank to %INC), but the import() function gets 
called for each use statement. Otherwise
        use Module::Name qw(Foo Bar);
        use Module::Name qw(Baz);
would not work.

And it behaves exactly the same on any OS.

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


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

Reply via email to