Nick Ing-Simmons wrote:
>Steve Hay <[EMAIL PROTECTED]> writes:
>
>Hi Steve, we meet again ;-)
>
It's a small world :)
>Tk and some other things I have done with multiple sub-dirs
>define a MMutil.pm e.g. Tk/MMutil.pm
>
>That looks like:
>
>------------------------------------------------------------
>package Tk::MMutil;
>@MYEXPORT = qw(pasthru perldepend ... );
>
>sub import
>{
> no strict 'refs';
> my $class = shift;
> my @list = (@_) ? @_ : @{"${class}::MYEXPORT"};
> my $name;
> foreach $name (@list)
> {
> *{"MY::$name"} = \&{"$name"};
> }
>}
>------------------------------------------------------------
>
>Then sub-Makefiles do
>use Tk::MMutil;
>
>The "import" via glob doesn't redefine the sub just puts in
>in the right place.
>
>Note that MakeMaker does extensive surgery to the symbol table
>to that each directory effectivley gets its own "MY::" space
>It gives me me feel ill every time I look at it.
>
Sounds like the surgery isn't quite extensive enough if the test() subs
in each MY:: space are still clashing. Perhaps a full autopsy is required.
>
>However Tk solves the problem you are having by overriding 'test'
>not in the subdirs, but in the top level (which is what
>calls tests in subdirs...) thus:
>
>[...]
>
>i.e.:
>
>save subdir list and clear it.
>See if there _are_ any tests in subdirs (skip if you know there aren't)
>call the normal MM::test with modified subdir list
>put subdirs back.
>
I like this solution the best. It's fairly clean and also has the nice
benefit that the sub-dirs still have their original "test" targets, so
if anyone cd's into them and runs "make test" then they do still get a
message about there not being tests, rather than getting no response at all.
Thanks!
- Steve
------------------------------------------------
Radan Computational Ltd.
The information contained in this message and any files transmitted with it are
confidential and intended for the addressee(s) only. If you have received this
message in error or there are any problems, please notify the sender immediately. The
unauthorized use, disclosure, copying or alteration of this message is strictly
forbidden. Note that any views or opinions presented in this email are solely those
of the author and do not necessarily represent those of Radan Computational Ltd. The
recipient(s) of this message should check it and any attached files for viruses: Radan
Computational will accept no liability for any damage caused by any virus transmitted
by this email.