in reply to Inline::C query
Hello Monks,
I am trying to test the functionality of Inline::c with small examples. For one shown below, I seem to get the result alright when I execute test.pl, still I want to take suggestions from you all. Please guide if I am doing it properly.
One more thing, suppose if I have a .dlls/c-libraries instead of the c-source code, will the approach remain the same? Any alternative ways? Basically, I want to keep perl code and .dlls/c-libraries in separate folders.
Hail Monks!
Raj
test.pl -------------------- use hello qw(addint); my $a=addint(9, 16); print "$a\n"; exit; hello.pm ------------ package hello; use strict; require Exporter; @ISA=qw(Exporter); @EXPORT_OK=qw(addint); use Inline (C => 'cfunction/addint.c'); 1; addint.c ----------------------------- int addint(int x, int y) { return x + y; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Inline::C query
by gellyfish (Monsignor) on Mar 02, 2005 at 12:01 UTC | |
by newbio (Beadle) on Mar 07, 2005 at 08:38 UTC |