On the shebang line seems unecessary to me (unless you have multiple options specified on the shebang line). On the command line makes more sense. "--" is a posix compliant way to end command line option processing via the getopt system command and is not limited to perl. It came into widespread use with the emergence of long form command line options (which usually begin with --). This removes some of the ambiguity that is present when both long and short options are valid. For example, if you saw:
$ mycommand -long
Is that -l -o -n -g, or the word long. With this:
$ mycommand --long
the intent is clear.
With option processing that can handle both long and short forms of options, with and without args, you need a way to determine where option processing (and any associated args) ends, and where command arguments begin. Use "--" to define that endpoint.
If you use even moderately complex command option processing, e.g. with Getopt::Std, you will find times when you must terminate option processing with "--". However, I doubt in the shebang line is one of those places. |