perl(9)
[Home]
[Commands]
[Variables]
[Macro-Dev]
[Glossary]
SYNOPSIS
FILES
hkperl.emf - Practical Extraction and Report Language file hook definition
perl.etf - Practical Extraction and Report Language header template file
perl.eaf - Practical Extraction and Report Language abbreviation file
EXTENSIONS
MAGIC STRINGS
#![ \t]*/.*perl
MicroEmacs recognizes the magic string on the first line of the file used to locate the executable. The Perl files may be extension-less and are still recognized.
# -*- perl -*-
MicroEmacs recognizes the standard GNU Emacs magic string on the first line of the file. The Perl files may be extension-less and are still recognized.
DESCRIPTION
The perl file type template provides the hilighting, indentation and tools definitions for a perl file.
File recognition is performed using the standard file extension .pl, .pm or by the magic string.
General Editing
On creating a new file, a new header is automatically included into the file.
time(2m) is by default enabled, allowing the modification time-stamp to be maintained in the header.
Hilighting
The hilighting features allow commands, variables, logical, comments, strings and characters of the language to be differentiated and rendered in different colors.
Abbreviations
The installation comes with a default abbreviation file for Perl file editing which can be used by writing short abbreviations like "if", "el" (else) or "sub" (subroutine) - and then pressing the key-binding for the
expand-abbrev-handle(3) command. The list of abbreviations can be used interactively in the GUI version of MicroEmacs using the
abbrev-list(3) command.
Auto Layout
Folding and Information Hiding
Generic folding is enabled within perl files. The folds occur about subroutine definitions located on the left-hand margin and their closing brace which is located at the beginning of a line.
collapse-all(3) (un)folds all regions in the file,
collapse-current(3) (un)folds the current region.
Navigation via Item List
The Perl mode offers beside folding as well support for displaying an outline of the subroutines for easy navigation using the
item-list(3) command.
Tags
A C-tags file may be generated within the editor using the Tools -> Perl-Tools -> Create Tag File.
find-tag(2) takes the user to the file using the tag information.
Short Cuts
The short cut keys used within the buffer are:-
C-c C-c - Comment out the current line.
C-c C-d - Uncomment the current line.
C-c esc esc - Command complete.
A-C-i - Restyle the current region.
f2 - (un)fold the current region
f3 - (un)fold all regions
f6 - list items
esc f6 - close item list
Executing, Formatting and Linting Perl Code
The Perl file hook supports the
file-exec(3), the
file-format(3) and the
file-lint(3) macros. The tools which are currently used are the "perl" interpreter, "perltidy" for formatting and "perlcritic" for linting. The latter two should be installable either via your default package manager or using the Perl "cpan" package manager.
Debugging
Debugging a perl script can be done inside MicroEmacs by using the
perldb(3) command.
NOTES
BUGS
The flexibility of the perl language does cause some hilighting anomalies from time to time, typically with unbalanced quote characters. Most of the common exceptions have been caught, however there are a few syntax sequences that involve quotation marks that can cause problems.
SEE ALSO
abbrev-list(3),
collapse-all(3),
collapse-current(3),
expand-abbrev-handle(3),
file-exec(3),
file-format(3),
file-lint(3),
indent(2),
find-tag(2),
item-list(3),
perldb(3),
perltags(3f),
restyle-buffer(3),
time(2m).
Supported File Types
(c) Copyright JASSPA 2025
Last Modified: 2025/08/28
Generated On: 2025/09/29