in reply to Re^7: inline in a perl module
in thread inline in a perl module

I think you really ought to take a look at line 15 of NewModule_b1a3.xs - as was suggested some time back by samtregar, and perhaps others (though, admittedly, not very forcefully by myself). It may just be a matter of missing newlines - but the XS file will show it up best.

I can generate the same error as you got with:
use warnings; use Inline CPP; greet(); __END__ __CPP__ void greet() { printf("Hello World\n"); }
(where there's no newline at the bottom of the script) but adding just one newline at the bottom of the script fixes the issue.

I suspect that the newline is being lost in the module - but seeing what's at line 15 of NewModule_b1a3.xs should enable us to confirm that. Perhaps that closing "1;" and the pod documentation need to be moved up above the "__END__" marker (or before the "__CPP__" marker) so that the pm file terminates with a newline immediately after the end of the cpp code.

Cheers,
Rob

Replies are listed 'Best First'.
Re^9: inline in a perl module
by nirf1 (Novice) on May 20, 2008 at 11:53 UTC
    Thanks Rob for your efforts, I managed to overcome those problems after I produced a new pm file from an example I found under ./Inline-0.44/modules/Math/Simple/Simple.pm after I solved those problems I encountered new ones in the form of linkage problems (I published them in another thread- which may have been a mistake). Thanks, Nir