
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Contents
perli
is a multi-platform Perl REPL (read-eval-print-loop)
for interactive experimentation with Perl code, convenient documentation lookups, and quick computations.
On Unix-like platforms, perli
makes use of the rlwrap
utility to provide
command-line editing support, persistent command history, and tab-completion;
see the Installation chapter below.
See the examples below, concise usage information further below, or read the manual.
Once you enter perli
, use ?
for help.
Results of expressions are automatically printed, which makes perli
handy
as an interactive calculator:
Results are printed with the Data::Dumper
core Perl module, which means
that they are reusable as input.
The following example inspects the special %INC
variable, which contains the
list of loaded modules. Note the first entry, which is perli
's own (optional)
initialization file.
The \
prefix here is not strictly necessary, but ensures that the hashtable is
printed in prettier form.
perli
provides the .remi
(for regular-expression match info)
command, which, in addition to an expression's own result, prints the values
of the special variables that Perl maintains about the most recent successful
regex match:
Invoking documentation overlays the REPL temporarily, as a man
page would
(not shown here).
By default, perli
tries to guess the type of the element to look up, and
invokes perldoc
behind the scenes accordingly.
The following is the equivalent of perldoc perlrun
:
This form is handy for lookups while you're in the middle of typing an expression.
The following is the equivalen of perldoc -f split
:
If the "fuzzy" default lookup doesn't find anything, or shows the wrong page,
you can use the prefix form with explicit perldoc
options.
The following example searches the FAQs (-q
) for the term while
(the default
lookup would have looked for the keyword).
perli
runs on Linux, macOS, Windows, and - as @matheusfillipe assures me - on Android, with Perl v5.6.2 or higher installed.
Using the manual installation process detailed below, perli
may work on other Unix-like platforms too.
On Unix-like platforms, perli
makes use of the rlwrap
utility, if present,
to provide command-line editing support, persistent command history,
and simple tab completion.
On Windows, rlwrap
is not available, unfortunately, but you do get
in-session history and basic command-line editing out of the box (but no
tab-completion).
You can install rlwrap
as follows:
Debian-based Linux distros such as Ubuntu:
sudo apt-get install rlwrap
Fedora:
sudo yum install rlwrap
macOS, via Homebrew:
brew install rlwrap
Unix-emulation environments for Windows:
Cygwin (Windows):
Re-run Cygwin's setup*.exe
and install
Utils
> rlwrap and Base
> libreadline*
MSYS / MinGW / Git Bash (Windows):
Sadly, rlwrap
is not offered. The next best thing is to use a
native Windows Perl version, with which you get at least basic command-line
editing and in-session history:
Deactivate the Unix Perl with mv /bin/perl /bin/perl.inactive
and install Strawberry Perl
All others: see rlwrap
's homepage
Note: Even if you don't use Node.js, its package manager, npm
, works across platforms and is easy to install; try curl -L http://git.io/n-install | bash
With Node.js or io.js installed, install the package as follows:
[sudo] npm install perli -g
Note:
sudo
depends on how you installed Node.js / io.js and whether you've changed permissions later; if you get an EACCES
error, try again with sudo
.-g
ensures global installation and is needed to put perli
in your system's $PATH
.perli
.chmod +x perli
.$PATH
, such as /usr/local/bin
(macOS) or /usr/bin
(Linux).perli.pl
.perli.pl
itself into a folder in your %PATH%
, or write a
wrapper batch file named perli.cmd
that invokes it.Find brief usage information below; for complete documentation, once installed, run man perli
(perli --man
on Windows and if installed manually), or read the manual online.
$ perli --help
A simple, convenient Perl REPL for interactive experimentation.
perli [<options>]
--norc skips loading of the initialization file
The following Perl options are also supported:
-M<name> (repeatable) load a module and import its defaults,
or activate a pragma (-M-<name> deactivates)
-m<module> (repeatable) load a module without importing
-I<dir> (repeatable) prepend <dir> to module search path (@INC)
Initialization file is ~/.perli_rc
Standard options: --help, --man, --version, --home
Copyright (c) 2015-2021 Michael Klement mklement0@gmail.com (http://same2u.net), released under the MIT license.
This project gratefully depends on the following open-source components, according to the terms of their respective licenses.
npm dependencies below have optional suffixes denoting the type of dependency; the absence of a suffix denotes a required run-time dependency: (D)
denotes a development-time-only dependency, (O)
an optional dependency, and (P)
a peer dependency.
Versioning complies with semantic versioning (semver).
v0.1.6 (2021-04-30):
perli
works too (tip of the hat for the PR).v0.1.5 (2021-02-23):
rlwrap
version 0.45, which in combination with Perl's exec
function caused a breaking change.v0.1.4 (2019-02-11):
v0.1.3 (2019-02-11):
v0.1.2 (2015-09-30):
my
) in older Perl versions (e.g., v5.14).v0.1.1 (2015-09-24):
v0.1.0 (2015-09-24):
FAQs
Multi-platform REPL for Perl
We found that perli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.