Project

peruby

0.0
The project is in a healthy, maintained state
Peruby runs a practical subset of Perl 5 without native extensions.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 1.7
 Project Readme

Peruby

Peruby is a Perl 5 interpreter written in pure Ruby. It runs a practical L4 subset: procedural Perl, regexes, references, file I/O, objects, use / require, compile phases, and selected core modules. It does not invoke a Perl binary at runtime.

Installation

Peruby requires Ruby 3.2 or newer.

gem install peruby
peruby --version

From a checkout, use bundle exec bin/peruby.

Usage

peruby script.pl arg1 arg2
peruby -e 'print "hello\n";'
peruby -n -l -a -F: -e 'print $F[0];' data.txt
peruby -MList::Util=sum -e 'print sum(1, 2, 3);'

Supported command switches include -e, -E, -c, -I, -n, -p, -l, -a, -F, -0, -M, -m, and -s. Debugging switches include --dump-tokens, --dump-ast, --dump-ops, --trace-ops, and --interpreter=tree. Set PERUBY_DEBUG=lexer,parser for both front-end traces.

The exact measured scope is in the compatibility report, and known differences are listed in INCOMPATIBILITIES.md. Pure-Perl CPAN compatibility is ongoing L5 work rather than a current promise.

Development

bundle install
bundle exec rake
bundle exec rake oracle
bundle exec rake bench

See CONTRIBUTING.md, DESIGN.md, and the roadmap.

License

MIT. See LICENSE.txt.