in reply to Using -- to terminate switch processing

Consider:

$ mkdir ./-e $ cat >./-e/test #!/usr/bin/perl -w die "It ran!"; __END__ $ chmod a+x ./-e/test $ ./-e/test It ran! at ./-e/test line 2. $ -e/test Search pattern not terminated at -e line 1. $
So the practice does prevent one problem. Not one you are likely to run into, but a problem still.

For that last command, perl gets executed with a command line that looks like:

perl -w -e/test
(at least on some operating system / shell combinations) and it doesn't know that "-e/test" is the name of a script file instead of the "-e" option asking it to interpret the code "/test" (which causes it to complain about not finding the terminating "/" for that pattern match).

I could envision some operating systems filling in the "--" for you such that including your own "--" would cause perl to report:

Can't open perl script "--": No such file or directory
though. So I'm not sure what to advocate at this point.

                - tye