Jeff Westman wrote: > Hi, > > I am using Active Perl under Windoze 98. I am trying to open a file that has > embedded spaces. I tried escaping the spaces as well, and that didn't work > either. > > #! perl -w > $file = "c:\\win\\start menu\\programs\\system\\tbs montego\\_visit turtle > beach web site.lnk"; > print "file = $file\n"; > open(F, "< $file") or warn "cannot open $file (continuing): $!\n"; > $file =~ s/ /\\ /g; > print "file = $file\n"; > open(F, "< $file") or die "cannot open $file: $!\n"; > close(F);
Don't escape spaces. They are not really control characters, so they don't need escaping. Instead, if the problem is the loss of double quotes, single-quote the whole thing: $file = '"c:\windows\start menu\programs\system\tbs montego\_visit turtle beach web site.lnk"'; Let us know if this works. Thestrategy here is to ensure that the double quotes are reatained until the are offered to Windows. Windos does need to see those double quotes when dealing with long filenames. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]