in reply to Parsing a list or Win32 filenames

You say the first file name can be "followed by three other filenames". How can you tell where the file names end? Is a b c d 4 file names, or 3 (say 'a', 'b' and 'c d')? Windows and/or many applications support using double quotes to surround arguemnts with spaces in them.

>perl -MWin32 -e "print(Win32::GetShortPathName($_), ' ') foreach (@AR +GV);" "My Documents" "Start Menu" MYDOCU~1 STARTM~1

If you want to implement double quoteing yourself...

sub deslash { local $_=$_[0]; s/\\(.)/$1/g; $_ } s/"((?:[^"\\]|\\.)+)"/ deslash($1) /ge;