use strict; use warnings; use Win32::API; my $GetTempPath = new Win32::API( 'kernel32', 'GetTempPath', 'NP', 'N'); my $lpBuffer = " " x 80; my $return = $GetTempPath->Call(80, $lpBuffer); my $TempPath = substr($lpBuffer, 0, $return); print $TempPath,$/;