# header stuff use feature ':5.10'; binmode(STDOUT, ":encoding(cp850)"); use Win32::API; # header end # ******************************* # -> THE MAGIC SHOULD START HERE: # ******************************* # invoke the function 'DOTP' within the Carbondioxide.dll # with 2 arguments, Double precision 'DD' and a Double precision return 'D' # (shall calculate the density of co2 at given temperature in Kelvin and pressure in MPa) # !!! ARGUMENTS shall be handed over BY REFERENCE whereas # RETURN values of the function are given back BY VALUE $function=Win32::API->new('CARBONDIOXIDE','DOTP','DD','D'); $T=300; $P=6; $return = $function->Call(\$T,\$P); # CRASHES here for unknown reason say $return."\n";