in reply to Re: How to get at perl's options in a program
in thread How to get at perl's options in a program

FWIW, you should not use Inline inside a module, you end up with

./Devel-PL_origargv-0.003/_Inline/lib/auto/Devel/PL_origargv_a77c/PL_o +rigargv_a77c.dll
which doesn't get installed, and and an empty
./Devel-PL_origargv-0.003/blib/lib/auto/Devel/PL_origargv/.exists
and then every time someone uses the module, in the current directory, an _Inline/lib/auto/Devel/PL_origargv_a77c/PL_origargv_a77c.dll is built, every single time, instead of once during installation

Replies are listed 'Best First'.
Re^3: How to get at perl's options in a program
by tobyink (Canon) on Apr 26, 2014 at 10:01 UTC

    It's not built every single time. It's only rebuilt if it's missing or if there have been modifications to the .pm file since the last build. If you don't like it being built in the current working directory, then create a ~/.Inline directory.

    I'd happily accept a patch to XSify the module, but I'm not going to write that myself. It seems more effort than would be deserved by this silly little module.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
      package Devel::PL_origargv; use strict; use warnings; our $AUTHORITY = 'cpan:TOBYINK'; our $VERSION = '0.004'; require DynaLoader; @Devel::PL_origargv::ISA = qw( Exporter DynaLoader); bootstrap Devel::PL_origargv; sub get { return _my_argc() unless wantarray; map _my_argv($_), 1 .. _my_argc(); } 1;

      #include "EXTERN.h" #include "perl.h" #include "XSUB.h" MODULE = Devel::PL_origargv PACKAGE = Devel::PL_origargv PROTOTYPES: DISABLE int _my_argc () CODE: RETVAL = PL_origargc; OUTPUT: RETVAL char * _my_argv (x) int x CODE: RETVAL = PL_origargv[x - 1]; OUTPUT: RETVAL

        OK, released as 0.004.

        use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

      I'd happily accept a patch to XSify the module, but I'm not going to write that myself. It seems more effort than would be deserved by this silly little module.

      Um, when you build it on your machine, copy the .xs files it generates, the end