NAME
App::AnteREPL - BASIC-style program editing with real Perl execution
SYNOPSIS
anterepl
$name = 'world';
10 say "Hello, $name";
LIST
10 say "Hello, $name";
RUN
Hello, world
EDIT
SAVE hello.bperl
QUIT
DESCRIPTION
App::AnteREPL installs the anterepl executable, with the banner *** PERL ANTE REPL V0.1 ***. It combines immediate Perl execution with an in-memory program indexed by line numbers. It requires Perl 5.16 or newer. Type HELP for the command reference.
Install from a release archive with cpanm ./App-AnteREPL-0.01.tar.gz, or run perl Makefile.PL, make test, and make install in the distribution. For development without installation, use perl -Ilib script/anterepl.
Numbers are editing addresses, not BASIC labels. RUN concatenates the stored lines in numeric order and evaluates them together, so blocks, subroutines, multiline strings, and heredocs work. Stored syntax/runtime errors report the corresponding numbered line when Perl supplies its source location.
COMMAND CASE
All AnteREPL commands and subcommands must be uppercase: LIST, AUTO OFF, AUTO ECHO ON, ENV SET, EDIT ENV, LIST SLOW, DUMP, and PEEK. Aliases such as DELETE, REORDER, CLEAR, and EXIT follow the same rule.
Lowercase and mixed-case words are not command aliases. Perl's lowercase eval keeps its normal behavior, and a user-defined list function can be called normally. If immediate input fails with a bareword error and its first word matches a REPL command, the interpreter error is replaced with a short spelling hint, for example:
cls
REPL commands must be uppercase; try, "CLS".
The command is not executed automatically. Valid Perl keywords, including eval, chdir, delete, and reset, retain their normal meaning and diagnostics. Defined functions keep their own diagnostics too. Unknown names, explicit EVAL code, and stored source retain normal Perl errors. Command arguments retain their case, including filenames, environment names, values, and Perl source. ENV set looks up the variable named set; ENV SET name value sets a variable.
Immediate definitions and implicit destination lists have the explicit grammar under "SHORTCUTS AND SHORTHAND". Ordinary Perl remains unchanged in numbered source, LOAD, IMPORT, EDIT, and literal EVAL. The lowercase definition tags follow E and are distinct from uppercase REPL commands.
SHORTCUTS AND SHORTHAND
Every command has a shortcut with one uppercase letter and at most one digit. Full names remain available, and arguments keep the same meaning:
A AUTO A0 AUTO OFF
A1 AUTO ECHO ON A2 AUTO ECHO OFF
C CLS C1 CD / CHDIR
D DUMP D1 DEL / DELETE
E EVAL E1 EDIT E2 EXPORT
F FUNCTIONS H HELP I IMPORT
L LIST L1 LOAD
L2 LIST SLOW L3 LIST PAUSE
N NEW / CLEAR P PEEK Q QUIT / EXIT
R RUN R1 RENUM / REORDER
R2 RESET R3 RECOVER
S SAVE S1 STATUS U UNDO
V ENV V0 ENV RESET V1 ENV SET
V2 ENV UNSET V3 ENV EDIT / EDIT ENV
V4 ENV SAVE V5 ENV LOAD V6 ENV RELOAD
V groups environment-variable operations. L2 5-20 means LIST 5-20 SLOW; L3 5-20 means LIST 5-20 PAUSE. Separate arguments with spaces: L1 file.pl loads, while L 1 lists line 1. There is no prefix guessing. Full command names retain their existing behavior.
Confirmation and force
Destructive shortcuts ask Continue? [y/N] before discarding or replacing state. Only y or yes approves. Enter, No, Ctrl-D, and Esc in screen mode cancel; Ctrl-C interrupts. Append ! to skip the question:
D1! 10-30
R2!
S! demo.pl
Q!
The supported force forms are C!, D1!, E1!, E2!, I!, L1!, N!, Q!, R1!, R2!, R3!, S!, U!, V!, and V0! through V6!. They protect source replacement/deletion, the live workspace, screen clearing/recovery, file overwrites, and environment changes. New files and new values do not ask. Q always asks, even when source is saved, because exiting also discards the live workspace. Editors prepare their results before asking to apply replacements. Invalid input and unchanged values do not ask.
Shorthand function/container redefinitions also ask. E! s triple return 4 * shift, E! a colors green, and colors! green, blue bypass their questions. New definitions need no confirmation. Declining leaves existing data intact and does not evaluate a replacement's expressions. Approved function redefinition retains Perl's usual warning.
Piped input cannot confirm and fails with a hint to append !; it never reads the next program line as an answer. Full-length commands retain their previous semantics. Arbitrary code evaluated by E/EVAL or RUN, and shell commands, has normal side effects; the REPL does not infer whether that code is destructive.
Explicit immediate definitions
E accepts five lowercase definition tags:
E s triple return 3 * shift
say triple 14
42
E a colors red, blue
E ar names Ada, "Grace Hopper"
E h options color => blue, count => 3
E hr record name => Ada, tags => [one, two]
These define a function, @colors, $names as an array reference, %options, and $record as a hash reference, respectively. Names are plain ASCII identifiers without sigils or namespaces. Omit the values to make an empty container, for example E ar names. A function must have a body.
Functions contain ordinary Perl, may recurse, and retain normal redefinition warnings. Open braces support multiline bodies. Prototypes, attributes, package names, and other advanced declarations belong in literal EVAL sub .... E s triple return 3 * shift defines a function. E reserves the five spaced tags for shorthand; EVAL always takes literal Perl. Thus EVAL s /old/new/ performs a spaced substitution, while E s/old/new/ also remains Perl because it has no spaced tag. Other ordinary Perl, such as E say triple 14, works directly with E.
Definitions are immediate and persist in the workspace between evaluations. They do not enter LIST or SAVE, including during AUTO; AUTO remains active. These are package variables, rather than lexicals limited to one evaluation.
Named lists with implicit quoting
With AUTO off, a lowercase-leading destination name followed by a top-level comma-separated list names an array. An arrow selects a hash:
a one, two, threee
D \@a
settings color => blue, count => 3
D \%settings
The first entry assigns @a = ('one', 'two', 'threee'). Spelling is preserved. Perl keywords and existing workspace functions take priority over bare destination names. Explicit E a ... and E h ... definitions select a destination even if a function has the same name. At least one top-level comma or arrow is required for the named-list form. E a names Ada handles a one-item list. During AUTO, a recognized named list is rejected with directions to use an explicit E definition or leave AUTO. Numbered and file source stay literal.
The value grammar
Every data form uses the same rules, recursively:
Commas separate items. Hashes require
key => valuefor each item. One trailing comma and one final statement semicolon are allowed. Missing items and mixed pairs/lists are errors.A word consisting of letters, digits, and underscores, beginning with a letter or underscore, becomes an exact string. The special word
undefis Perl undef. Simple signed decimal numbers, fractions, and exponents remain numbers.Single and double quotes have their ordinary Perl meaning, including escapes and interpolation. Quote spaces, punctuation, empty strings, and leading zeroes:
"two words","red-blue","","042". No spelling correction occurs. Native quote operators also work directly:q{a,b},qq{hi $name},qw(one two),qr/pattern/, substitutions, transliterations, and command quotes. Quoted commas/arrows are never separators. Quote operators take precedence over implicit words; write"q"or"s"when those words are literal data next to delimiters. Lists expand in array context; each hash key/value still receives scalar context. Command quotes execute normally.A simple scalar such as
$countrefers to its live value. Square brackets construct array references; braces construct hash references. Their contents follow this same grammar, so[one, {color => blue}]needs no word quotes.Parentheses mark an explicit Perl expression, for example
(1 + 2),(1..3),($ENV{HOME}), or(\%ENV). Expressions have list context in arrays and scalar context in each hash key/value position. Hash duplicate keys keep the last value, as in Perl. Nested array/hash literals cannot be hash keys.
Unquoted punctuation or multiword values are not guessed. An ambiguous entry gets a friendly explanation and is rejected before evaluation. Nothing is compiled or run to classify input. Once accepted, explicit Perl expressions and function bodies execute once with normal warnings/errors and side effects; those effects are not rolled back. EVAL always accepts literal Perl; E reserves its five shorthand tags and otherwise evaluates Perl. Stored programs are never rewritten as shorthand.
Function calls without parentheses
Use ordinary Perl call syntax when the function is already defined:
EVAL sub triple { 3 * shift }
say triple 14
42
Prototypes keep Perl's usual parsing rules, including scalar, list, and block arguments. AnteREPL does not insert or remove call parentheses:
EVAL sub scalar_arg ($) { 3 * $_[0] }
say scalar_arg 14
42
EVAL sub total (@) { my $n = 0; $n += $_ for @_; $n }
say total 1, 2, 3
6
EVAL sub apply (&@) { my $f = shift; map { $f->($_) } @_ }
say join q{,}, apply { $_[0] * 2 } 1, 2, 3
2,4,6
The parentheses in prototype declarations and code-reference calls above are intentional. Keep parentheses where Perl requires them or where they clarify argument grouping. A prototype declared by RUN is also available to later immediate calls.
AUTO ENTRY
AUTO lets you enter program source without typing editing numbers:
AUTO
say "hi"
say "there!"
AUTO OFF
LIST
5 say "hi";
10 say "there!";
The default increment is 5. With an existing program, AUTO starts 5 past its highest number. AUTO 100 chooses a start; AUTO 100 10 also chooses a step. Occupied numbers are skipped, so AUTO never silently overwrites stored lines. Explicitly numbered entries still edit or delete the indicated line.
AUTO OFF returns to immediate execution. Ctrl-C or Ctrl-D while entering text also ends AUTO and discards only the unfinished entry, retaining stored source. Ctrl-D leaves the REPL running when AUTO is active. In plain terminal mode, use Ctrl-D on an empty physical input line; piped EOF still ends batch input. Blank entries do nothing. LIST, RUN, EDIT, SAVE, ENV, and other commands remain available; EVAL code executes immediately while AUTO is active. STATUS shows the next number and step.
Single-line entries get the usual implicit semicolon. Open delimiters continue onto subsequent rows, just as in immediate mode; the complete multiline entry is stored together, preserving its literal source and requiring its own final semicolon. Each physical line receives a number. A multiline paste is also stored together; UNDO reverses the entire entry. : exact source stores one literal line without continuation or an inserted terminator, useful for heredoc contents and other unusual syntax. AUTO does not echo a second, numbered copy by default; use LIST to see assigned numbers. AUTO ECHO ON enables those copies; AUTO ECHO OFF disables them. This preference lasts for the session and does not start or stop AUTO. Typed screen text and AUTO status/error messages remain visible.
SESSION-ONLY FUNCTIONS
Use a named subroutine to install a function in the current REPL workspace's symbol table without adding its definition to the numbered program:
AUTO OFF
EVAL sub triple {
return 3 * shift;
}
say triple 14
Press ordinary Enter after the closing brace. The definition prints nothing; the next entry calls it and prints 42. EVAL also works while AUTO is active, but leaves AUTO on. Use ? triple 14 for an immediate call during AUTO.
Prototypes work the same way: E sub twice ($) { 2 * $_[0] } completes with one Enter, and say twice 21 on the next entry prints 42. If the body is still open, input continues until its closing brace. While collecting an unfinished entry, text such as CLS is part of that entry, not a command. Press Ctrl-C to cancel it and return to fresh input. Ctrl-D outside AUTO exits when the stored program has no unsaved changes.
The function lives in the workspace package of this Perl process. It is callable by immediate input and RUN, but does not appear in LIST or SAVE. CLS and NEW/CLEAR retain it. RESET selects a fresh workspace where that name is no longer defined. Here "session-only" does not mean Perl's local keyword or a lexical my sub; it is a normal named package subroutine.
To persist a definition deliberately, enter its source as numbered lines, through AUTO, or through EDIT, then SAVE the program. There is no automatic copying of evaluated source into the program or session serialization.
Listing functions
FUNCTIONS prints defined function names in the current workspace, one per line in alphabetical order. It includes imported functions and aliases in that package, but excludes other packages, forward declarations without a body, and anonymous functions held only in variables. An empty workspace reports No functions defined in this workspace. The command must be uppercase, takes no arguments, and works during AUTO without storing or executing source. Definitions in numbered source appear only after RUN installs them.
Redefining functions and running setup code
Statements outside a subroutine body run once each time the EVAL entry is submitted. The named subroutine remains available afterward. For example:
EVAL do {
$setups++;
sub triple { return 3 * shift; }
}
FUNCTIONS
say triple 14
Defining triple again replaces the function used by subsequent calls and normally prints Perl's Subroutine triple redefined warning. There is no confirmation prompt. Existing code references, such as $old = \&triple, still call the previous body. Perl warning controls such as no warnings 'redefine' apply within the entry as usual.
Evaluation is not transactional: named subroutines are installed at compile time, so a later runtime exception does not undo their definitions or other side effects already performed.
ENVIRONMENT
ENV
ENV PATH
ENV SET GREETING 'hello world'
ENV UNSET GREETING
EDIT ENV
ENV SAVE session.env
ENV LOAD session.env
ENV RELOAD
ENV RESET
ENV displays the current process environment as sorted VAR=value lines. Direct Perl changes such as $ENV{FOO} = 'bar' and delete $ENV{FOO} are also visible. Changes affect subsequent Perl evaluations and child shell commands. They do not change the parent shell. RESET alone resets only Perl variables; ENV RESET restores the environment captured when AnteREPL started.
EDIT ENV (also ENV EDIT) opens a private temporary environment.env in the same editor as EDIT. Save and close it to replace the live environment. Deleting a variable's line unsets it; an empty file clears the environment. Invalid input or an unsuccessful editor exit leaves the environment unchanged. Program source and its UNDO stack are separate from environment edits.
ENV SAVE writes a snapshot. ENV LOAD replaces the whole environment from a file; it does not merge. ENV RELOAD re-reads the last successfully loaded or saved environment file, or an explicitly supplied filename. EDIT ENV changes memory only; ENV SAVE writes those changes to disk. No command can re-read later changes made in the parent shell; save a file there and ENV LOAD it.
The file format is ordinary VAR=value, with optional export prefixes, blank lines, and # comments. Unquoted values have outer whitespace removed; a hash preceded by whitespace starts a comment. Single-quoted values are literal. Double-quoted values support \\n, \\r, \\t, \\\\, \\", and \\xHH. Quotes preserve leading/trailing spaces and hashes. UTF-8 text is supported, with byte escapes for non-UTF-8 values. Duplicate names and NUL values are rejected. Names cannot contain whitespace, equals signs, hashes, quotes, or NUL. Values are never expanded: dollar signs, command substitutions, and backticks remain data. ENV SET uses shell-style argument quoting, also without expansion; single quotes are useful for Windows backslash paths.
EDITOR=vim
GREETING="hello world"
LITERAL='$HOME stays literal'
ENV subcommand names are reserved after ENV. Inspect a variable called SET, for example, with DUMP $ENV{SET}.
LISTING PROGRAMS
LIST left-aligns the line numbers and pads on their right, so the Perl source starts in one column. The column width follows the largest number in the selected range. This display padding never changes saved source or adds extra indentation when a listed screen row is edited and submitted again.
LIST
LIST 10
LIST 10-50
LIST 10-
LIST -50
LIST10-50
LIST SLOW
LIST 10-500 PAUSE
Ranges are inclusive; spaces around the hyphen are accepted. Long listings scroll upward row by row in screen mode. Space pauses/resumes, S toggles normal/slow speed (approximately 33/4 rows per second), Enter steps one row and remains paused, and Q/Esc/Ctrl-C stops. Other typing or cursor movement stops LIST and passes that key to the editor. The temporary control hint is not stored in screen memory. SLOW starts slowly; PAUSE stops after each screenful. Plain mode and piped output never wait for keys or insert listing delays.
IMPLICIT SEMICOLONS
Ordinary numbered entries supply a missing final semicolon when stored:
10 say "hi"
LIST
10 say "hi";
Existing terminators are retained. Full-line comments and common block or continuation lines are left alone. A supplied semicolon goes before a trailing comment, and hashes inside quoted strings are not treated as comments.
This convenience is not a complete Perl parser. For deliberate multiline expressions, multiline strings, heredoc contents/terminators, POD, or unusual syntax, use a colon immediately after the editing number to store exact source:
10: my $text = <<'TEXT';
20: hello
30: TEXT
40 say $text
The colon is an input instruction and is not part of the stored source. EDIT, IMPORT, and LOAD also preserve literal source; they do not insert semicolons. An already stored line is normalized only when re-entered without the colon.
EDIT
EDIT writes the current program, without line numbers, into a private temporary program.pl and starts $EDITOR, falling back to $VISUAL, then vi (notepad on Windows). Set an editor that waits until editing is finished:
export EDITOR=vim
export EDITOR='code --wait'
The editor command is parsed into an executable and arguments; it is not passed through a shell. Quote an executable path containing spaces. Windows paths should use forward slashes when setting EDITOR. Shell expansions, pipes, and redirections are not supported in EDITOR; use a wrapper script if needed.
After a successful exit, the saved UTF-8 file replaces the in-memory program, renumbered 10,20,30,... . An unchanged file preserves the existing numbering. Failure to start, nonzero exit, a missing/unreadable file, invalid UTF-8, NUL bytes, or bare CR characters leaves the existing program intact. LF and CRLF files are accepted. Blank lines are retained. UNDO restores the previous program after a successful edit, including its numbering.
EDIT never runs or syntax-checks your source. Incomplete Perl is allowed in the buffer; RUN reports errors. This avoids executing BEGIN blocks merely by editing. Temporary editor files are removed when EDIT finishes.
WORKSPACE
Immediate input and RUN share a Perl package. $x = 1 and our $x = 1 persist between evaluations, along with package arrays, hashes, and subroutines. my variables are local to one immediate evaluation or one complete RUN. Pragmas and lexical imports must be repeated in each evaluation that needs them; say is enabled by default. Evaluation uses scalar context. Use ? expression for Data::Dumper output; ordinary input does not automatically print its return value. EVAL code bypasses command and line-number parsing. EVAL must be uppercase; lowercase eval retains Perl's string/block evaluation and exception-catching behavior. All REPL commands and subcommands must also be uppercase.
RESET switches to a fresh workspace but keeps the source program. NEW/CLEAR clear the source but retain the workspace. RUN does not reset variables first. An exception does not roll back side effects. This runs ordinary Perl with your account's privileges; exit exits the tool. UNDO affects only stored source, not executed Perl, shell commands, or saved files.
To execute several blocks together without storing source, leave AUTO off and type or paste a do { ... } entry, or use EVAL do { ... } during AUTO:
EVAL do {
my $total = 0;
for my $n (1 .. 3) { $total += $n; }
if ($total > 0) { say $total; }
};
This prints 6 and leaves the stored program unchanged. Delimiter continuation holds the entry until its closing brace. Bracketed paste also groups multiline text and waits for Enter; the enclosing block works when typing line by line.
Named subroutines defined by immediate input persist in the shared workspace. A definition in stored source becomes callable after RUN evaluates the program:
10 sub twice { return 2 * shift }
RUN
say twice 21
This prints 42. RUN executes the whole program, including other top-level statements. LOAD and LIST only deal with source; they do not define functions. Editing or deleting source does not change an already defined function until it is redefined or RESET selects a fresh workspace. Use LIST or EDIT to revisit the stored definition, and EVAL say twice 21 to call it during AUTO.
DIRECTORIES
CD and its alias CHDIR change AnteREPL's own working directory:
CD ..
CHDIR '/path/to/work'
CD 'directory with spaces'
With no argument they use HOME, or USERPROFILE on native Windows if HOME is unset. Paths are literal; quote spaces. These commands do not expand shell variables or ~. A failed change gives an explanation and retains the current directory. Lowercase chdir remains ordinary Perl, including expressions:
chdir $ENV{HOME} or die $!
Relative file commands and future child processes use the changed directory. ! cd ... changes only its short-lived child shell, not AnteREPL. Neither form can change the parent shell's directory.
FILES AND RECOVERY
LOAD accepts ordinary Perl source as well as UTF-8 numbered files bearing a PERL ANTE REPL header. Plain source receives numbers 10,20,..., preserving comments, blank lines, and indentation. It is never executed during loading. A .bperl filename must have a valid native header; files starting with a PERL ANTE REPL header are validated as native regardless of extension.
SAVE remembers the loaded filename and format. SAVE file.pl writes plain source without editing numbers; SAVE file.bperl writes numbered source. Other extensions retain the current format (native for a new program). Plain source normalizes line endings to LF and ends every stored line with a newline. IMPORT file remains available to bring in plain source as an unsaved copy without adopting its filename. Old # BASIC PERL V0.1 headers remain compatible; native-format saves write # PERL ANTE REPL V0.1.
EXPORT writes an ordinary Perl script with a small prelude enabling the same default pragmas. Workspace values are never serialized. Exported programs must initialize the values they need to run independently.
File writes use a temporary file in the destination directory and rename it after a successful close. LOAD validates the whole file before changing the buffer. LOAD, IMPORT, NEW/CLEAR, and QUIT refuse to discard unsaved changes; append ! to those commands to override. UNDO remembers the last 50 program changes. The save filename is not rolled back by UNDO. Editing does not save your source file: use SAVE afterward. No automatic crash recovery is provided.
Interactive exits through QUIT, EXIT, Q, their ! forms, or Ctrl-D print Thank, we hope something good happens to you today! on its own line. In screen mode this happens after restoring the original terminal display and default cursor style. The farewell is omitted from piped/batch output.
SCREEN EDITING AND MULTILINE INPUT
The screen is a small sheet of graph paper
The area inside the white border is the working "VRAM". An 80-column, 24-row terminal has 78 columns by 21 rows of editable cells: the border uses two columns and two rows, and a command legend uses the bottom row. The border and legend are outside VRAM; cursor movement, scrolling, LIST, CLS, and RECOVER operate on the interior. There are no extra rows above it or columns hiding to the right. New output at the bottom scrolls old rows away. Long input and output wrap at the right edge. Wrapped source remains one line of Perl; wrapping does not insert a newline into its code.
The legend shows common command spellings with highlighted labels. Type a label such as H, L, or Q and press Enter; these are not Ctrl-key bindings. H lists all commands. Narrow windows show fewer legend items, keeping Help and Quit first. Below three columns or four rows the frame and legend are omitted. Plain mode has no frame or command legend.
The input loop blinks the cursor every half second by toggling its visibility, without relying on the terminal's native blinking setting. Insert requests a bar shape; overwrite requests a block. Cursor-shape support determines whether the shape changes. Typing makes the cursor visible immediately. Plain mode leaves cursor appearance to the terminal.
Think of resizing as changing the size of a sheet of graph paper:
Smaller: cells at the right and bottom are cut off.
AnteREPL first keeps one separate copy of the screen, then crops the active area and prints a warning. The warning can itself scroll rows away. It tells you the full terminal size needed for recovery, including space for the border and legend. There is no confirmation question.
Bigger: new cells are empty.
No warning is needed. Cropped text does not come back automatically. The saved copy is not active: cursor keys cannot reach it and Enter cannot run it.
RECOVER: ask for the saved sheet back.
Enlarge to at least the dimensions in the warning, then type
RECOVER. This replaces the current screen with the saved copy, including screen edits made before shrinking. It does not merge newer screen text or execute code. It refuses if the terminal is still too small. The copy is consumed on success.
Repeated shrinking keeps the first unclaimed copy, so dragging a window edge does not replace it with already-cropped text. CLS clears both the active screen and this copy. Neither is saved between sessions. Ordinary scrolling does not create a recovery copy. The app checks dimensions while waiting for input, so resizing does not need a keystroke; running Perl must return control or print before the screen can refresh.
An entry damaged by cropping or scrolling cannot be submitted as partial Perl. Re-enter it, recover an intact screen, or use EDIT for larger source. HELP pauses by screenful; LIST PAUSE and line ranges let you read source without losing it above the screen. PageUp and Ctrl-Home stay inside the visible area. Plain mode has no screen bank or RECOVER.
The numbered program is a separate notebook. Resizing, scrolling, CLS, and RECOVER do not change its source, your variables, functions, or environment. LIST copies stored source back onto the screen; SAVE writes that source to a file. EDIT opens the stored program, not a picture of the screen.
This follows the C64 screen-editor idea: move through displayed text and press Return to submit it. Its character screen was 40 by 25; AnteREPL uses your terminal's dimensions. Resizing and the recovery bank are AnteREPL features, not C64 hardware emulation. See the original Commodore 64 User's Guide.
Editing visible entries
Interactive mode uses an ANSI screen with no input prompt or shell-style command history. New output scrolls the view upward. Arrow keys move the cursor through displayed input and output, including LIST output. Edit a numbered row and press Enter to update the stored program. Editing screen text alone does not change the program or execute it. When you resubmit an earlier entry, its new output replaces its previous output immediately below the entry, and the cursor stays just below the new result. If another entry follows, the cursor moves to its start without inserting a blank spacer or erasing that entry. Shorter or silent results remove stale output rows; blank lines deliberately printed by Perl remain. Later entries and their output remain while they fit; Esc or Ctrl-End moves to fresh input at the bottom. Multiline entries put their result below the whole group, even when you press Enter on a row in the middle. This changes only the screen display: executing Perl still repeats its normal side effects.
CLS clears the display and resize bank, returning the cursor to the top left. The stored program, live Perl variables, %ENV, AUTO settings, save filename, unsaved status, and source UNDO remain intact. LIST displays the program again; RUN still executes it. CLEAR instead erases the stored program, while Ctrl-L only redraws existing screen text. In plain mode, CLS emits clear/home escapes only to a terminal whose TERM is not dumb; it produces no output when redirected or piped.
Typing inserts characters by default, including when editing earlier rows; Insert switches between insert and overwrite. Backspace/Delete remove characters, Home/End move within a row. Left at the start of a row moves to the end of the previous row, stopping at the visible top row. Empty rows are visited one at a time. PageUp/PageDown move within visible screen text. Esc or Ctrl-End returns to a blank row at the bottom; Ctrl-Home visits the top row. Ctrl-U clears a row, Ctrl-L redraws, and Ctrl-C cancels input or interrupts running Perl. Ctrl-C also shows exit directions: QUIT, QUIT! to discard unsaved source, or Ctrl-D when AUTO is off and source is saved. There is no saved history. Wide/combining Unicode glyphs can misalign the cursor; the editor assumes one terminal cell per character.
Shift-Enter or Ctrl-N inserts a newline at the cursor without submitting, splitting the current row and keeping it in the same multiline group. This works even when the entry is already complete. Enter submits the entire group once its delimiters are closed, including from a row in the middle. Insert mode still controls whether subsequent typing inserts or overwrites text.
Shift-Enter requires the terminal to report a distinct key sequence. CSI-u ESC [ 13 ; 2 u and xterm ESC [ 27 ; 2 ; 13 ~ are recognized. If the terminal sends ordinary Enter for both keys, AnteREPL cannot distinguish them; use Ctrl-N or configure Shift-Enter to send one of those sequences. These editing keys apply to screen input, not --plain or program STDIN reads.
For immediate Perl, Enter continues on the next screen row while a brace, bracket, parenthesis, or quoted literal remains open. Once closed, Enter submits the whole entry. Earlier multiline entries remain grouped when edited and resubmitted. Bracketed multiline paste waits for Enter before evaluating. No extra continuation prompt is printed, and input is never compiled merely to decide whether it needs another row. This is delimiter continuation, not a complete Perl parser; use EDIT or literal numbered lines for heredocs/POD and complex source. Numbered program lines retain their existing single-line rules.
DUMP expression is a prompt command backed by Data::Dumper::Dumper:
$FOO = {
bar => 1,
names => [qw(Alice Bob)],
};
DUMP $FOO
DUMP \%ENV
PEEK expression calls the core Devel::Peek::Dump directly on the expression, including an optional limit, e.g. PEEK $FOO or PEEK $FOO, 10. Its native stderr output is captured into the editable display. These are prompt commands; in stored Perl use the module functions explicitly. They do not redefine Perl's CORE::dump keyword.
Perl print/say/warn output and simple <STDIN> line input use the screen. ! command captures external stdout/stderr into screen rows when it finishes, with closed input. Use !! command for interactive external programs; it lends them the real terminal and waits for Enter before returning to the screen. EDIT likewise restores normal terminal settings while your editor runs. Use these escapes for external programs: direct system/exec calls and arbitrary XS terminal output bypass the screen model.
Screen mode needs an ANSI-capable terminal. On Unix, it uses core POSIX terminal support, or Term::ReadKey if installed. Native Windows requires Term::ReadKey (cpanm Term::ReadKey); its Windows backend has not been validated here. --plain disables screen editing and uses plain input with no prompt or history. The old --no-readline flag is an alias for --plain.
--quiet suppresses the banner. A startup filename is loaded but never executed automatically. Piped input uses plain mode and supports the same immediate delimiter continuation. Batches return a nonzero status after command errors, incomplete input at EOF, or unsaved stored source at EOF. Outside AUTO, Ctrl-D refuses to exit an interactive session with unsaved source. Source files and workspace values have the same lifetime rules in both terminal modes.
SEE ALSO
https://github.com/oodler577/p5-App-AnteREPL/wiki contains installation, first-session, editing, environment, and troubleshooting walkthroughs. Type HELP for the complete command and keyboard reference, also available from anterepl --help.
AUTHOR
Brett Estrade
COPYRIGHT AND LICENSE
Copyright (c) 2026 Brett Estrade.
This software is free software; you may redistribute it and/or modify it under the same terms as Perl itself.