Hi alan,

alan burlison [26/09/01 19:07 +0100]:
> So why does this:
> 
> package Elf;
> use strict;
> use warnings;
> our $VERSION = '0.01';
> use Inline (
>         C       => 'DATA',
>         VERSION => $VERSION,
>         NAME    => 'Elf',
> );
> 1;

Because $VERSION isn't assigned the value '0.01' until runtime, and use
statements are processed at compile time. You can do this instead:

  package Elf;
  use strict;
  use warnings;
  our $VERSION;
  BEGIN {
      $VERSION = '0.01';
  }
  use Inline (
        C       => 'DATA',
        VERSION => $VERSION,
        NAME    => 'Elf',
  );
  1;

Later,
Neil

> /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.
> 
>  at -e line 0
> INIT failed--call queue aborted.
> *** Error code 255
> 
> This is with Inline version 0.43.
> 
> Thanks!
> 
> -- 
> Alan Burlison
> --
> $ head -1 /dev/bollocks
> concisely utilize neteconomy open-source product feature sets

Reply via email to