# The following was supposedly scribed by
# David Christopher Asher
# on Monday 24 May 2004 02:16 pm:

>Hi,
>
>I recently broke up the CPP DATA block of a perl module I wrote into 6
>smaller, organized '.c' files.  I did this for several reasons -- better
>syntax highlighting in my editor, easier to navigate than scrolling through
>several thousand lines of code, and with luck it would only recompile the
>pieces that changed, rather than the whole thing.
>
>Anyway, This is how I _am_ doing it, which does not work:
>
>use Inline (Config => DIRECTORY => '/home/me/this_project/inline');
>use Inline CPP => "/home/me/this_project/basics.c";
>use Inline CPP => "/home/me/this_project/draw.c";
>use Inline CPP => "/home/me/this_project/analysis.c";
>use Inline CPP => "/home/me/this_project/output.c";
>use Inline CPP => "/home/me/this_project/vector.c";
>use Inline CPP => "/home/me/this_project/remotesensing.c";
>

Check out my scheme of using the BEGIN block in
Math::Geometry::Planar::GPC::Polygon.  This allows you to keep the "*.c"
files relative to the .pm file (or $0 if you are writing a script?) and
not have to use absolute paths.

If you go this route, you also then have the ability to open() each file
and concatenate them all into a string.  I imagine that this may be the
only way to solve the specific problem which you reference above.  Maybe
check the receive_code() function in Inline.pm for the why.

>What I find odd is that it's not the first file I included, or the last, but
>the third which made it in.  It's the first alphabetically, and maybe that's
>it, but I don't know why.  Anyway, am I including the files wrong?  The
>documentation on cpan.org is rather vague on the subject of including source
>_files_, and I searched Google and usenet without much luck on the subject.
>I'm hoping someone here could help.

I also use the separate files (for basically the same reasons) and would
sure like to see more documentation for that method (of course, then the
code is not really 'Inline'.)

--Eric

-- 
"Chess is a foolish expedient for making idle people believe 
they are doing something very clever when they are only wasting 
their time."
                                        --George Bernard Shaw



Reply via email to