use Win32; my $long = 'c:\\program files\\microsoft office\\'; my $short = Win32::GetShortPathName($long); print $short;