in reply to readdir and short file names

while (defined($long_file_name = readdir(DIR))) { my $short_path = Win32::GetShortPathName("$dir\\$long_file_name"); (my $short_file_name = $short_path) =~ s#^.*[\\/]##; ... }

For fun,

$dir = ...; @files = map { (split(' ', substr($_, 39)))[0] } split("\n", `dir /x "$dir"`);

will also do the trick.