use strict; use Win32::API; # Load the DLL my $dll = Win32::LoadLibrary('CrappyLibrary.dll') || die $^E; # Import the function my $func = new Win32::API('CrappyLibrary.dll','RegisterClient2','PP','I'); if (not defined $func) {die "Unable to import 'RegisterClient2' function.\n";} my $client_id = 1; my $ip_addr = "192.168.1.1"; # Call the function my $value = $func->Call($client_id,$ip_addr); # unload DLL Win32::FreeLibrary($dll);