林です。

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)