On Wed, 16 Jun 2004 20:49:26 -0500, Ken Williams typed:
>
> 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__;

Ah yes, the magic of BEGIN - I thought it was a timing issue. Thanks.

>
>> 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.

Ok. I give. My next checkin will jump to 1.10 and that will solve that problem.
>
>> 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.

I didn't want to turn off the versioning, just the checks. Believe me, I'm more into 
version than you imagine, having ported an early version of the version.pm module by 
John Peacock to a Perl-only (no XS) implementation. The solutions above solve those 
problems. Seems to me, they should end up in the docs. I know, I know, patches welcome 
:-)

Thanks

> -Ken

--
Matthew O. Persico


Reply via email to