----- Original Message -----
From: "Clodius, Bob" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 13, 2002 1:51 AM
Subject: making a ppd module


> Hi,
>
> I am using inline 0.43 and I tried running your example of converting
> math::simple to a ppd module.  When I run  'nmake test' I get an error
> msg  "The NAME 'Math::Simple::Stuff' is illegal for this Inline
> extension.  The NAME must match the current package name:  Math::Simple"
>

Just been looking at what I did when I went through that exercise. In the
inline-faq you'll see that simple.pm contains the section:
    use Inline (C => 'src/Simple.c' =>
                NAME => 'Math::Simple::Stuff',
                VERSION => '1.23',
               );

I changed that second line to:
                NAME => 'Math::Simple',
and it worked fine. (Included the C code in the '.pm' file rather than in a
separate file, but I don't think that has any bearing on the problem. Also
haven't built the ppm package, but it could be built with the "usual" ppm
build process once the module has been compiled.)

Any other references to "Stuff" (eg in 'makefile.pl') would also have to be
deleted

It might not be the *only* way to fix the problem, but it's the only way *I*
could find :-)

Below is a cut'n'paste of the 'Simple.pm' file and the 'makefile.pl' I ended
up using.

Cheers,
Rob

--------------------<Simple.pm>
package Math::Simple;
use strict;
require Exporter;
@Math::Simple::ISA = qw(Exporter);
@Math::Simple::EXPORT = qw(add subtract);
$Math::Simple::VERSION = '1.23';

use Inline (C => DATA =>
     NAME => 'Math::Simple',
     VERSION => '1.23',
    );

1;

__DATA__
__C__
int add (int x, int y) {
    return x + y;
}

int subtract (int x, int y) {
    return x - y;
}

---------------------<makefile.pl>
use Inline::MakeMaker;

WriteInlineMakefile( NAME => 'Math::Simple',
              VERSION_FROM => 'Simple.pm',
            );


Reply via email to