in reply to Using Inline::C in a package
use Inline C;
... the "C" here is a bareword, so strict 'subs' doesn't like it. You could drop use strict, or you could quote "C" in single or double quotes...
use Inline 'C';
... or use the magic quoting power of the fat comma...
use Inline C => ();
Also, I'm pretty sure you want __DATA__ instead of __END__. __END__ behaves the same as __DATA__ in scripts, but not in modules.
Personally I don't like the __DATA__ loading bit of Inline::C; I just use:
use Inline C => q{ /* my C code goes here */ };
(or heredocs).
PS: a very simple module using Inline::C is Devel::PL_origargv - take a peek at the source code and let me know if you have any questions about it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Inline::C in a package
by rem45acp (Novice) on Sep 04, 2013 at 17:18 UTC |