Alan,

Because the '$VERSION = '0.20' is happening at runtime, but the 'use 
Inline...' is happening at compile time.  So $VERSION isn't set yet when 
you pass it to Inline.

You can probably do:

 use vars qw($VERSION);   # Or our($VERSION)
 BEGIN { $VERSION = '0.01' }
 use Inline (
         C       => 'DATA',
         VERSION => $VERSION,
         NAME    => 'Elf',
 );


alan burlison <[EMAIL PROTECTED]> wrote:
> According to the Inline docs:
>
> package Math::Simple;
> use strict;
> use vars qw($VERSION @ISA @EXPORT_OK);
> require Exporter;
> @ISA = qw(Exporter);
> @EXPORT_OK = qw(add subtract)
> $VERSION = '0.20';
> use Inline C => 'DATA',
>            VERSION => '0.20',
>            NAME => 'Math::Simple';
> 1;
>
> So why does this:
>
> package Elf;
> use strict;
> use warnings;
> our $VERSION = '0.01';
> use Inline (
>         C       => 'DATA',
>         VERSION => $VERSION,
>         NAME    => 'Elf',
> );
> 1;
>
> Give this error?
>
> /usr/bin/perl -Mblib -MInline=_INSTALL_ -MElf -e1 0.01 blib/arch
> Using /home/alanbur/ws/Elf/blib
> An Inline extension module requires an explicit VERSION.

Reply via email to