in reply to Perl's glob behaviour
The first case is different from the others. Using warnings helps there:
$ perl -wle 'print <x>' Name "main::x" used only once: possible typo at -e line 1. readline() on unopened filehandle x at -e line 1.
Using B::Deparse on the other three tells us that they use the same program structure:
$ perl -MO=Deparse -le 'print <x*>' BEGIN { $/ = "\n"; $\ = "\n"; } use File::Glob (); print glob('x*'); -e syntax OK
Using that snippet for your first case as well gives:
$ perl -MFile::Glob -wle 'print glob "x"' x
So glob treats the two first cases differently. The documentation says that it implements csh semantics. I guess that's why.
|
|---|