use Win32 qw( ); # Win32 doesn't export these, so we'll import them manually. BEGIN { no strict 'refs'; *$_ = \&{"Win32::$_"} for qw( GetLongPathName GetFullPathName ); } my $path = "\\DOCUMENTS AND SETTINGS"; # If you wish to keep relative paths relative: print GetLongPathName($path); # If you wish to make relative paths absolute: print GetLongPathName(scalar(GetFullPathName($path)));