Why does Perl's glob() function always return a file name when given a string with no globbing characters?
问题 I gave a list of globs and one string to Perl's glob function. The globs were treated as expected but the string is always found. For example: $ ls foo $ perl -le '@files=glob("*bar"); print @files' ## prints nothing, as expected $ perl -le '@files=glob("bar"); print @files' bar As you can see above, the second example prints bar even though no such file exists. My first thought is that it behaves like the shell in that when no expansion is available, a glob (or something being treated as a