This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
Subject: shebang line question From: "Stefan" <parallax99@hotmail.com> Date: Thu, 26 Oct 2000 14:30:04 -0700 Hey guys, I'm going over some legacy code. In my own programs, I normally use the shebang line: #!/usr/local/bin/perl5 -w This guy, however, used: #!/usr/local/bin/perl5 -w -- -*-Perl-*- Anyone else ever seen anything like this before? Is it doing something special that I should be aware of, or is this just some alternative method of commenting? === Subject: Re: shebang line question From: Josh Rabinowitz <joshr@joshr.com> Date: Thu, 26 Oct 2000 14:33:43 -0700 I believe it's for emacs, so it'll go into 'perl' mode. joshr === Subject: Re: shebang line question From: ivan <ivan-sfpug@420.am> Date: Thu, 26 Oct 2000 14:37:59 -0700 On Thu, Oct 26, 2000 at 02:30:04PM -0700, Stefan wrote: > Hey guys, > I'm going over some legacy code. In my own programs, I normally use > the shebang line: > #!/usr/local/bin/perl5 -w > > This guy, however, used: > #!/usr/local/bin/perl5 -w -- -*-Perl-*- > > Anyone else ever seen anything like this before? Is it doing something > special that I should be aware of, or is this just some alternative method > of commenting? The `--' tells perl to ignore anything else on the shebang line (well, as switches, anyway). The `-*-Perl-*-' is an emacs hint, iirc. See the `perlrun' manpage. === Subject: Re: shebang line question From: Ashton MacAndrews <ashton@get.topica.com> Date: Thu, 26 Oct 2000 14:40:39 -0700 Stefan <parallax99@hotmail.com>: > Hey guys, > I'm going over some legacy code. In my own programs, I normally use > the shebang line: > #!/usr/local/bin/perl5 -w > > This guy, however, used: > #!/usr/local/bin/perl5 -w -- -*-Perl-*- It allows emacs to enter a given mode ... You can specify which major mode should be used for editing a certain file by a special sort of text in the first nonblank line of the file. The mode name should appear in this line both preceded and followed by `-*-'. Other text may appear on the line as well. For example, ;-*-Lisp-*- tells Emacs to use Lisp mode. Such an explicit specification overrides any defaulting based on the file name. Note how the semicolon is used to make Lisp treat this line as a comment. Another format of mode specification is -*-Mode: MODENAME;-*- which allows you to specify local variables as well, like this: -*- mode: MODENAME; VAR: VALUE; ... -*- ===