ingydotnet / inline-c-pm

10 stars 19 forks source link

use Inline C; doesn't work with strict mode #69

Closed akarelas-pt closed 5 years ago

akarelas-pt commented 6 years ago

However, use Inline C; is written in the POD documentation.

mohawk2 commented 6 years ago

Could you give a test case, most ideally in the format that would fit in a .t file, to show the problem?

akarelas-pt commented 6 years ago

I don't know how to make a test out of it. But here it is:

#!/usr/bin/env perl

use strict;
use warnings;

use Inline C;

__END__
__C__
void greet() {
    printf("Hello\n");
}

If you try to execute this perl script, you get an error:

Bareword "C" not allowed while "strict subs" in use at test.pl line 6.
Execution of test.pl aborted due to compilation errors.
mohawk2 commented 6 years ago

Oh, right! Yes, that's just a syntax thing. Normally one says use Inline C => ... which makes the C a string. By itself, one needs to just go use Inline 'C'. Want to PR a doc-fix?

perlpunk commented 5 years ago

Fixed by #70