On Jun 16, 2004, at 7:51 PM, Matthew O. Persico wrote:
I managed to get Inline::C to work OOTB with a local crypt library. I have a few questions/comments:
1) I use $VERSION = qw($Revision 1.2$)[1] to generate my version numbers from the CVS version number. Why doesn't this expression work as the value of the VERSION argument to use Inline C =>.... For that matter, if I define
our $VERSION = qw($Revision 1.2$)[1];
why can't I just stick that in Inline C VERSION?
You can. But I'm guessing you're doing this:
our $VERSION = qw($Revision 1.2$)[1]; use Inline C => 'DATA', VERSION => $VERSION, NAME => __PACKAGE__;
That doesn't work because the 'use' statement happens at compile time, and the 'our' statement assignment happens at runtime (too late). You can change to something like this, though:
our $VERSION; BEGIN { $VERSION = qw($Revision 1.2$)[1]; } use Inline C => 'DATA', VERSION => $VERSION, NAME => __PACKAGE__;
2) I tried hard-coding 1.2 as the valid id number, but Inline didn't like it. Why is the regexp for valid Inline Versions /\d.\d\d/?
Because it wants you to use 1.02 instead. It's better when you go from 1.09 to 1.10 than from 1.9 to 1.10.
3) I know what I am doing and the module I am building is not going on CPAN. Is there any way to turn off the checks?
You still need versioning even for stuff that's not on CPAN. It's a good habit to get into. I don't think there's any way to turn it off.
-Ken