Path: ccsf.homeunix.org!ccsf.homeunix.org!news1.wakwak.com!nf1.xephion.ne.jp!onion.ish.org!gcd.org!vda-gw!news.moat.net!news.imp.ch!news.imp.ch!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Takumi Hayashi Newsgroups: fj.comp.lang.perl Subject: Re: =?iso-2022-jp?B?V2lsZC5wbRskQiRIJTklWiE8JTkkJCRqJVUlISUkJWtMPhsoQg==?= =?iso-2022-jp?B?GyRCJE5MZEJqGyhC?= Date: Tue, 22 Mar 2005 20:36:31 +0900 Lines: 67 Message-ID: <4240033F.E47CA998@hayashi.dnsalias.net> References: <423E10A4.56BA5A6B@ht.sakura.ne.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Trace: individual.net 7DZxsfAO5HNBVWMJzXcldAXao+9dN1MNNYFFNlSIb8us3ZVo/p X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: ja,en Xref: ccsf.homeunix.org fj.comp.lang.perl:109 林です。 IIJIMA Hiromitsu wrote: > 次に、 > C:\> perl -MWild -e "print qq'@ARGV'" "C:\Program Files\*" > とすると、 > (1) の環境では C:\Program Files\* > (2) の環境では C:./\Program Files\* > という出力が出ます。 > > Wild.pm は File::DosGlob を使っていますが、これのバグなのでしょうか? File::DosGlob のドキュメントに *.dll')" globs all filenames that end in ".exe" or ".dll". If you want to put in literal spaces in the glob pattern, you can escape them with either double quotes, or backslashes. e.g. "glob('c:/"Program Files"/*/*.dll')", or "glob('c:/Program\ Files/*/*.dll')". The argument is tokenized using "Text::ParseWords::parse_line()", so see Text::ParseWords for details of the quoting rules used. とあり、Text::ParseWords のドキュメントには backslashes, etc.) are kept in the tokens. If $keep is false then the &*quotewords() functions remove all quotes and backslashes that are not themselves backslash-escaped or inside of single quotes (i.e., とあるのでこれに従って C:\>perl -MWild -e "print qq'@ARGV'" "C:\\Program\ Files\\*" としたところ、ファイル名が多数出力されました。 (Windows 2000 & ActivePerl build 811) ちなみに PERL_SRC/win32/Makefile の # uncomment to enable linking with setargv.obj under the Visual C # compiler. Setting this options enables perl to expand wildcards in # arguments, but it may be harder to use alternate methods like # File::DosGlob that are more powerful. This option is supported only with # Visual C. # #USE_SETARGV = define を有効にし、VC6 でコンパイルした perl では C:\> perl -e "print qq'@ARGV'" "C:\Program Files\*" C:\Program Files\* C:\> perl -e "print qq'@ARGV'" "C:\\Program\ Files\\*" C:\\Program\ Files\\* C:\> perl -e "print qq'@ARGV'" "C:\windows\*" C:\windows\* C:\> perl -e "print qq'@ARGV'" C:\windows\* (ファイル名がたくさん) となりました。 -- 林拓美(Takumi Hayashi)