Subject: | Compile error if final newline is missing |
Running the attached file which does not have a final newline fails with the error message
Didn't find a 'MODULE ... PACKAGE ... PREFIX' line
This is probably caused by putting the MODULE XS keyword into the last line of the cpp source code. In the generated .xs file I see
int add(int a, int b) {
return a + b;
}MODULE = cpp_pl_b0a5 PACKAGE = main
Inline::C does not have this problem.
Regards,
Slaven
Subject: | cpp.pl |
#!/usr/bin/perl
use strict;
use Inline 'CPP';
warn add(1,2);
__END__
__CPP__
int add(int a, int b) {
return a + b;
}