Perl::...riables(3pm)

πŸ“¦
version 1.003 Β· 2 versions
, in fedora 43

πŸ’– NAME πŸ’– (bestie, this is the one)

okay so you're looking at Perl::Critic::Policy::Editor::RequireEmacsFileVariables β€” and yeah the manual calls it Per-file editor settings ✨ like, it's the policy that cares whether your file is telling your editor how to treat it. no cap.


πŸŽ€ AFFILIATION πŸŽ€ (where this policy hangs out)

This policy is part of Perl::Critic::More β€” which is literally described as a bleeding edge supplement to Perl::Critic. it's giving bonus content, deluxe edition, the extended cut πŸ’…


🌸 DESCRIPTION 🌸 (the lore, explained)

Many text editors know how to find magic strings in files that indicate settings that work best for that file πŸ¦‹ like bestie, the file itself is out here saying "hi, i would like four-character indentation please." iconic behavior.

In emacs, this magic string is called "File Variables" and there are two syntaxes, periodt:

  • "-*- ... -*-" β€” the single-line one
  • "Local Variables:\n...\nEnd:" β€” the multi-line one

and the way that both syntaxes allow leading and trailing text on the line?? yeah. flexible queens πŸ‘‘

✨ the single-line syntax ✨

The single-line syntax must be used on the first line of the file to be recognized β€” or on the second line if the first line is a shebang. (shebang privileges, iykyk 🐚)

The following examples are explicitly allowed by Perl:

#!perl -w -*- cperl -*-
#!perl -w # -*- cperl -*-
#!perl # -*- cperl -*-

look at them. three little icons. all valid. we love to see it πŸ’–

πŸ’œ the multi-line syntax πŸ’œ

The multi-line syntax must be used "in the last page" β€” that is, after the last formfeed β€” at the end of the file. πŸ“„

As of Emacs21, the "end of the file" is hard-coded to be the last 3000 bytes of the file (in the hack-local-variables function in files.el). yes bestie, 3000. very specific. very main character of them.

In this syntax, each line must begin and end with the same prefix/suffix pair. That pair is defined by the text before and after the "Local Variables:" string. so it's a matching set. a coordinated outfit. slay 🌈


πŸ‘‘ SEE ALSO πŸ‘‘ (the required reading, bestie)

In Emacs, you can view the "File Variables" info node by typing: "Help-key", "i", "g", "(emacs)File Variables" β€” where "Help-key" is often "C-h" or "F1". 🧚

Alternatively, you can execute the following elisp:

(info "(emacs)File Variables")

one line. does the whole thing. lowkey iconic 😌


🫢 AUTHOR 🫢 (the legends themselves)

  • Chris Dolan <cdolan@cpan.org>
  • Michael Wolf <MichaelRWolf@att.net>

thank you for your service πŸ«‘πŸ’–


Copyright (c) 2006-2008 Chris Dolan

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. πŸ“œ

okay bestie real talk β€” that's the whole policy. every option, every example, every byte count, all of it. nothing skipped, nothing invented. you're welcome πŸ’–

and that's a wrap, gorgeous ✨ this was perl v5.42.0, dated 2025-07-25, and yes we were all reading Perl::...riables(3pm) together the whole time πŸŒˆπŸ’–πŸŽ€ go forth and set your file variables, periodt.

πŸ“¦ where this page comes from