in reply to Re: Using module with c code in perl program.
in thread Using module with c code in perl program.

Out of curiosity, does quoting the requirement of Inline help? ie. use Inline 'C' ... I don't have access to Windows at the moment, so I can't test.

For that matter, kind of goes without saying, but you can compile a C program outside of Perl in your setup, yes?

Replies are listed 'Best First'.
Re^3: Using module with c code in perl program.
by Don Coyote (Hermit) on Dec 21, 2015 at 22:57 UTC

    the quoting does not make a difference. from the docs there are various ways of getting the code in. The problem seems to be more that the DATA handle is being read without being opened first.

    inside Inline, c_calc::DATA is aliased into Inline::DATA, and then read in after requiring Socket, but this is used just for CR and LF definitions. I hardcoded those definitions and commented out the Socket require, to no effect. then the subroutines goes on to read-in the aliased Inline::DATA. (my $data = <Inline::DATA>) =~ s/$CR?$LF/\n/g;

    I can compile a C program, using the gcc compiler which comes with Strawberry, I did so to ensure the C code was running before attempting to inline. This would indicate that I already have C compatibility from Strawberry, which makes the "not understanding C language" error contradictory.