----- Original Message ----- From: "Patrick LeBoutillier" <[EMAIL PROTECTED]> To: "Nicholas Wehr" <[EMAIL PROTECTED]> Cc: <inline@perl.org> Sent: Thursday, April 07, 2005 12:04 PM Subject: Re: 'USE'ing an Inline module from within an Inline module
> I've done a bit of investigating and here's what I make of this problem: > > In your generated Makefile, there is a line like this: > > $(PERL) -Mblib -MInline=NOISY,_INSTALL_ -MRabbit -e1 0.14 $(INST_ARCHLIB) > > The way I figured Inline works is as such: each time it is 'use'd with > the DATA keyword, it stores an reference to an object describing the > Inline section in question in a list. Later, inside an INIT block, it > loops through the list and "glues" each section. > > In the above scenario, it is used twice with DATA: once with Rabbit > and once with Turtle. So when in compares the correct version with > $ARGV[0], it's good for Rabbit but not for Turtle. > Yes - I won't disagree with any of that. But this suggests to me that Inline's mistake is that it checks against $ARGV[0] when it should be checking against something else .... the question being just what is that "something else" ? The answer to that question (if there is one) might provide a solution to the problem ?? > Basically I see only one way of fixing this: in _INSTALL_ mode, stop > everything after having processed the first Inline section. > Can that be done easily ? I don't know how one would do that. > During these tests I also noticed such a message popping up: > > One or more DATA sections were not processed by Inline. > I don't think the 'DATA' mentioned there relates to the use of the keyword 'DATA' in the Inline script/module. Even if your script/module makes no mention of the 'DATA' keyword then you can still get that message (see below). And if you write your Rabbit and Turtle modules without using the 'DATA' keyword and the '__DATA__' section you still get that version mismatch error (though, from memory, it occurs at a different stage in the build process .... I'll check on that). > This basically happens sometimes because depending when/how Inline is > loaded, the INIT block never gets run so the gathered Inline section > never get processed. > > I'm thinking one should expect this to work: > > require Turtle ; > Turtle->relative_speed() ; > > But it doesn't unless you say "use Turtle"? Is this a known/documented > bug/feature? > I've not seen mention of it before. Interesting that attempts to 'require' an Inline module also invariably elicit the response: One or more DATA sections were not processed by Inline. In fact - you'll see that message whenever you 'require' any file that contains, for example, simply 'use Inline C;' (You've got a lot further than I could, Patrick. I hate digging into the Inline source - I guess it's very well written - but to me it's just plain obtuse :-) Cheers, Rob