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.