Sorry about the top-posting, thanks Slowtus Bloats.

Anyway, WRT the versioning, I ended up using:

our $VERSION = qw ($Revision 1.02 $)[1];

use Inline
  C => 'Config',
  LIBS => '-llfcrypt',
  VERSION => qw ($Revision 1.02 $)[1],
  NAME => __PACKAGE__;

I need the first line to convince perl Makefile.PL that there is a valid
version.
I need the version information in the 'use' entry to keep Inline happy.

When I tried:

our $VERSION;

BEGIN {$VERSION=qw ($Revision 1.02 $)[1];}

use Inline
  C => 'Config',
  LIBS => '-llfcrypt',
  VERSION => $VERSION,
  NAME => __PACKAGE__;

perl Makefile.PL choked; it saw the our $VERSION; line, parsed it to undef and
barfed.

So, as long as I needed to repeat the version (once for MM, once for Inline) I
dispensed with the BEGIN.

--- Original Message ---
From: "Ken Williams" <[EMAIL PROTECTED]>
To: Matthew O. Persico <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wed, 16 Jun 2004 20:49:26 -0500
Subject: Re: Wow, it works - but still nits to pick

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

--
Matthew O. Persico










Reply via email to