FYI,
I'm changing Inline to parse the DATA section as suggested below; with
one difference. You'll need to specify a pod stripping filter manually
using the new FILTER option and the included Inline::C::Strip_POD()
filter. Like this:
use Inline C => DATA =>
FILTERS => 'Strip_POD';
There will (eventually) be a number of handy prepackaged filters. You
can also specify your own. And you can stack them to your hearts
delight:
use Inline C => DATA =>
FILTERS => [Strip_POD => \&my_filter => Expand_Includes];
Cheers, Brian
Tim Gim Yee wrote:
>
> The following code does not DWIM. As documented, the __C__ section ends
> at the first POD command =head1. Is there a reason for this? I would
> like to freely intermix POD and C code just as I do with POD and Perl
> code.
>
> #!/usr/bin/perl -w
>
> use Inline C;
>
> print "9 + 16 = ", add(9, 16), "\n";
> print "9 - 16 = ", subtract(9, 16), "\n";
>
> __END__
> __C__
>
> =head1 add
>
> Add two numbers.
>
> =cut
>
> int add(int x, int y) {
> return x + y;
> }
>
> =head1 subtract
>
> Subtract two numbers.
>
> =cut
>
> int subtract(int x, int y) {
> return x - y;
> }
>
> --
> Tim Gim Yee
> [EMAIL PROTECTED]
--
perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf
("Just Another %s Hacker",x);}};print JAxH+Perl'