in reply to Unexplained glob behavior vs. Bash shell

These work as expected:

$ perl -le'print for < abc/OneWord >' abc/OneWord $ perl -le'print for < abc/Two Words >' abc/Two Words $ perl -le'print for < abc/Two\\ Words >' abc/Two Words $ perl -MFile::Glob=bsd_glob -le'print for bsd_glob("abc/Two Words")' abc/Two Words

Remember, space is a pattern separator unless you use bsd_glob from File::Glob. You need to precede it with a backslash for it to be interpreted literally.

I can't account for the different in

$ perl -le'print for < '\''abc/OneWord'\'' >' 'abc/OneWord' $ perl -le'print for < '\''abc/Two Words'\'' >' abc/Two Words

You can get consistent behaviour by using bsd_glob or by treating ' as a meta character.

$ perl -MFile::Glob=bsd_glob -le'print for bsd_glob("'\''abc/OneWord'\ +''")' 'abc/OneWord' $ perl -MFile::Glob=bsd_glob -le'print for bsd_glob("'\''abc/Two Words +'\''")' 'abc/Two Words'
$ echo '< \\'\''abc/OneWord\\'\'' >' && > perl -le'print for < \\'\''abc/OneWord\\'\'' >' < \\'abc/OneWord\\' > 'abc/OneWord' $ echo '< \\'\''abc/Two\\ Words\\'\'' >' && > perl -le'print for < \\'\''abc/Two\\ Words\\'\'' >' < \\'abc/Two\\ Words\\' > 'abc/Two Words'

So:

I consider glob (aka < GLOBEXPR >) to be buggy and obsoleted by bsd_glob.