use Win32::API; my $filename="C:/Windows/ieuninst.exe"; my $Api = new Win32::API("fileversion.dll", "GetFileVersionTxt", P, P); # Set some memory aside for the returned value my $output = "\x00" x 1024; # Call the function in the dll $Api->Call($filename,$output); # Remove the unused padding in the string my $final = ($output =~ /(.*?)\x00/); print "\output - $final";