isdev has asked for the wisdom of the Perl Monks concerning the following question:

Can anyone enlighten me as to what this does please? "#! /usr/bin/perl -- -*- C -*-" My best guess is that the -- has been used to 'comment out' the -*-... bit.

Replies are listed 'Best First'.
Re: Command Line Switches
by vlsimpson (Beadle) on Nov 18, 2009 at 17:49 UTC
    The -*- C -*- is for the Emacs text editor. It's for setting file specific modes and variables. Choosing modes documentation. Apparently someone wanted c mode instead of perl or cperl modes. Go figure. ;)
Re: Command Line Switches
by ikegami (Patriarch) on Nov 18, 2009 at 19:09 UTC
    It's not a command line switch. "--" marks the end of the command line switches. That's the case for just about every unix tool.
    $ ls -l * ls: invalid option -- - Try `ls --help' for more information. $ ls -l -- * -rw------- 1 eric users 0 2009-11-18 14:08 -a-

    Another trick is to provide an equivalent path that doesn't start with "-":

    $ ls -l ./-a- -rw------- 1 eric users 0 2009-11-18 14:08 ./-a-

    And finally,

    $ rm -- -a- $

    Since it's not a command line switch, it's completely ignored by Perl.

Re: Command Line Switches
by kennethk (Abbot) on Nov 18, 2009 at 17:44 UTC
    Though I'm not familiar with these particular elements, they are discussed in the DESCRIPTION section of perlrun, your key to all command line switch questions.