R. Joseph Newton wrote:
>
> Just a hunch, since the material in question is out of reach, but
> could this be a circular reference?  It happens a lot when assembling
> C headers.  If Train.pm by any chance has a "use ScheduleDay;"
> statement, then that would porobably cause some havoc.

In general you don't get the same problems in Perl that you do in
C, as 'require' is smart. If you call

    require File;

it first checks $INC{'File.pm'} to see if it has already been included.
If not then it goes ahead and looks through the paths in @INC
to find the module file. When it is found, $INC{'File.pm'} is set
to the module file's absolute path, and  a 'do' performed on it.
Thereafter, if the same 'require' is encountered, the file will
not be read again as its entry in %INC is defined.

Having said this, the initial compilation unit (ScheduleDay.pm)
isn't added to the INC hash, so if it 'require's a module which
then 'require's the original file again it seems to me that the
redefinition warning will be issued.

Even so, all of this is speculative until we can see the real thing,
so in the meantime I'm sticking with my simpler possibility:
that Train.pm doesn't have a 'package Train' statement!

> It might be worth the bandwidth for Rob R. to post all three
> files--the two modules as well as the driver used to test them.

Definitely. Then we can rewrite it for him.

;-)

Rob




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

Reply via email to