in reply to Using Inline::C in a package
cannot seem to figure out how to embed the C code in a perl package
Incidentally, you can have multiple packages in the one Inline::C script (just as you can with perl scripts):
Rob
Incidentally, you can have multiple packages in the one Inline::C script (just as you can with perl scripts):
Which outputs:package FOO; use Inline C => <<'EOC'; void hello() { printf("Hello from FOO\n"); } EOC package BAR; use Inline C => <<'EOC'; void hello() { printf("Hello from BAR\n"); } EOC package FUBAR; use Inline C => <<'EOC'; void hello() { printf("Hello from FUBAR\n"); } EOC FOO::hello(); BAR::hello(); FUBAR::hello(); hello();
Cheers,Hello from FOO Hello from BAR Hello from FUBAR Hello from FUBAR
Rob
|
---|
In Section
Seekers of Perl Wisdom