1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
use strict; use warnings; use Inline ( C => 'DATA', directory => 'inline_dir', name => 'Hello', ); hello(); __DATA__ __C__ #include <stdio.h> void hello(){ puts("Hello 123!!"); }
1 2 3 4 5 6 7
use strict; use warnings; use Win32; use Win32::API; my $dll = Win32::LoadLibrary('Hello') || die $^E; my $f = Win32::API::More->new("Hello", "void hello()") or die $^E;