perl6 - the Rakudo Perl 6 Compiler's switches and environment variables
perl6 [switches] [--] [programfile] [arguments]
With no arguments, enters a REPL (see --repl-mode option). With a "[programfile]" or the "-e" option, compiles the given program and, by default, also executes the compiled code.
Option Purpose====== ==============================================-c check syntax only (runs BEGIN and CHECK blocks)--doc extract documentation and print it as text-e program one line of program, strict is enabled by default-h, --help display this help text-n run program once for each line of input-p same as -n, but also print at the end of lines-I path adds the path to the path-M the to running the program--target=stage specify compilation stage to emit--optimize=level use the given level of optimization (0..3)--encoding=mode specify string encoding mode-o, --output=name specify name of output file-v, --version display version information--stagestats display time spent in the compilation stages--ll-exception display a low level backtrace on errors--profile[=kind] write profile information to an HTML file (MoarVM)instrumented - performance measurements (default)heap - record heap snapshots after everygarbage collector run--profile-filename=nameprovide a different filename for profile. Extensioncontrols format:.json outputs in JSON.sql outputs in SQLany other extension outputs in HTML--doc= Pod::To::[module] to render inline documentation--repl-mode=interactive|non-interactivewhen running without "-e" or filename arguments,a REPL is started. By default, if STDIN is a TTY,"interactive" REPL is started that shows extra messages andprompts, otherwise a "non-interactive" mode is used whereSTDIN is read entirely and evaluated as if it were a program,without any extra output (in fact, no REPL machinery is evenloaded). This option allows to bypass TTY detection andforce one of the REPL modes.
Note that only boolean single-letter options may be bundled.
To modify the include path, you can set the PERL6LIB environment variable:
PERL6LIB="lib" perl6 example.pl
The include path will be searched recursively for any modules when Rakudo is started. Directories that start with a dot are ignored and symlinks are followed.
The supported values for
|parse||all||a representation of the parse tree|
|ast||all||an abstract syntax tree (before optimizations)|
|optimize||all||an abstract syntax tree (after optimizations)|
|mbc||MoarVM||MoarVM byte code|
--profile-filename, specifying a name ending in
.json will write a raw JSON profile dump. The default if this is omitted is
For examples, and notes about correct quoting on Windows, see "Perl 6 One Liners".
Rakudo's behavior can be tweaked by a (growing) number of environment variables; this section attempts to document all those currently in use.
Other variables are listed in Rakudo's github wiki: https://github.com/rakudo/rakudo/wiki/dev-env-vars.
Enables verbose information about Perl 6 pod tables. Useful for tweaking table pod for the user's intended output.
Appends a comma-delimited list of paths to
RAKUDOLIB is evaluated first.
src/Perl6/ModuleLoader.pm) Causes the module loader to print debugging information to standard error.
src/core/Exception.pm) Specifies the name of a custom exceptions handler. For example, to load and use
Exceptions::JSON class that comes with Rakudo, set this env var to
JSON. The exception handling class needs to implement method
process that takes a single positional argument: the exception object. If that method returns a truthy value, the exception will also be printed to the terminal, as if the exception handler was not specified.
src/core/Deprecations.pm) If true, suppresses deprecation warnings triggered by the
is DEPRECATED trait.
src/core/Deprecations.pm) If true, deprecation warnings become thrown exceptions.
src/core/Backtrace.pm) Displays source code in stack frames surrounded by the specified number of lines of context.
src/core/Backtrace.pm) Controls whether .setting files are included in backtraces.
src/core/CompUnit/RepositoryRegistry.pm) When this is set, Rakudo will look for the standard repositories (perl, vendor, site) in the specified directory. This is intended as an escape hatch for build-time bootstrapping issues, where Rakudo may be built as an unprivileged user without write access to the runtime paths in NQP's config.
src/core/CompUnit/PrecompilationRepository.pm) These are internal variables for passing serialized state to precompilation jobs in child processes. Please do not set them manually.
src/core/REPL.pm) Specifies what line editor to use. Valid values are
none, which load Linenoise or Readline line editors, or starts the default (
none) line editor that doesn't require any extra modules.
src/core/Exception.pm) Controls whether to emit ANSI codes for error highlighting. Defaults to true if unset, except on Win32.
src/core/ThreadPoolScheduler.pm) Override the default maximum number of threads used by a thread pool. Defaults to
perl6-jdb-server for setting the jdb port
perl6-jdb-server with increasing ports for precompilation and
perl6-jdb-server is for setting the jdb port.
IO::Spec::Unix.tmpdir method will return
$TMPDIR if it points to a directory with full access permissions for the current user, with a fallback default of
IO::Spec::Win32 use more Win32-appropriate lists which also include the
%TMP% environment variables.
IO::Spec::Unix.path method splits
$PATH as a shell would; i.e. as a colon-separated list.
IO::Spec::Cygwin inherits this from
IO::Spec::Win32.path will read the first defined of either
%Path% as a semicolon-delimited list.
When set to a true value will cause timing information to be printed when the test suite is running:
$ PERL6_TEST_TIMES=1 perl6 -MTest -e 'plan 2; is sleep(2), Nil; nok sleep(.5)'1..2# between two timestamps 1 microsecondsok 1 -# t=2000562ok 2 -# t=500388
# between two timestamps is printed when
plan is called and indicates how long it takes just to read the clock to produce a timestamp.
# t= values that follow are printed after each test function is executed and the value represents the time in microseconds that elapsed from the previous timestamp (or the
# between... message).
Note that if you use
done-testing instead of
# between... message will not be displayed and the first
# t= value will be a
When set to a true value will cause the test suite to abort on first failure, even if there are more tests to be run:
$ PERL6_TEST_DIE_ON_FAIL=1 perl6 t/test-filename.t
When set to a true value, causes to produce extra debugging output, useful for debugging Rakudo's static optimizer.
Set to enable scheduler debugging.