perl6(1)
β¨ perl6(1) β¨
okay bestie, listen π this is the User Contributed Perl Documentation page for perl6, section 1 of the manual. Yes the title says perl6 but the thing it documents is raku, and honestly? iconic. Let's go. π¦
πΈ NAME πΈ
raku β the Rakudo Raku Compiler. that's it, that's the whole name, slay π
β¨ SYNOPSIS β¨
raku [switches] [--] [programfile] [arguments]
look at her. so simple. so powerful. π
π DESCRIPTION π
If you run her with no arguments at all, she drops you into a REPL. Live. Interactive. Just you and the prompt. π«Ά
If you give her a [programfile], or you use the -e option, she compiles the program you gave her β and by default she also executes the compiled code. So it actually runs. no cap.
here's the full switch lineup, every single one, no skips:
-cβ check syntax only (and yes, it still runsBEGINandCHECKblocks)--docβ extract documentation and print it as text-eprogram β one line of program, and 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-Ipath β adds the path to the module search path-Mmodule β loads the module prior 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β write profile information as HTML file (MoarVM)--profile-filenameβ provide a different filename (also allows.json)--doc=[module]β UsePod::To::[module]to render inline documentation.--full-cleanupβ try to free all memory and exit cleanly (MoarVM)--debug-port=portβ listen for incoming debugger connections (MoarVM)--debug-suspendβ pause execution at the entry point (MoarVM)--tracingβ output a line to stderr on every interpreter instr (only if enabled in MoarVM)
β οΈ heads up bestie: only boolean single-letter options may be bundled. don't get cute with the multi-letter ones.
π« the --target values π«
here's what you can ask her to emit, plus which backend it belongs to and what it actually is:
parseβ backend:allβ a representation of the parse treeastβ backend:allβ an abstract syntax tree (before optimizations)optimizeβ backend:allβ an abstract syntax tree (after optimizations)mbcβ backend:MoarVMβ MoarVM byte codejarβ backend:JVMβ JVM archive
π§ about --profile-filename π§
if the name you give it ends in .json, she writes a raw JSON profile dump. and if you just omit it entirely, the default is profile-[timestamp].html. so cute, so timestamped. β
π ENVIRONMENT VARIABLES π
Rakudo's behavior can be tweaked by a (growing) number of environment variables, and this section is doing its best to document all of the ones currently in use. They are interpreter specific in all cases β except where some use conventional names such as PATH. π«‘
The underlying virtual machine is also sensitive to a whole series of environment variables; those are listed in this wiki page: <https://github.com/rakudo/rakudo/wiki/dev-env-vars#moarvm> (sorry bestie, no clickable links in here, you're gonna have to copy-paste it π).
β¨ Module loading β¨
RAKUDOLIB,RAKULIB(Str;src/core/Inc.pm) βRAKUDOLIBandRAKULIBappend a comma-delimited list of paths to the search list for modules.RAKUDOLIBis evaluated first. NOTE: These env vars were added in the Rakudo compiler in version2020.05. The deprecated older env varPERL6LIBis still available.RAKUDO_MODULE_DEBUG(Bool;src/Perl6/ModuleLoader.nqp) β If true, causes the module loader to print debugging information to standard error.
π Error message verbosity and strictness π
RAKU_EXCEPTIONS_HANDLERβ If present, theprint_exceptionroutine will use a class of that name to process the exception for output. Rakudo currently ships withExceptions::JSON(invoked by setting this variable toJSON), to override the default output. NOTE: This env var was added in version6.e. Early implementation has been available in Rakudo compiler as of version2019.12, and before that it was available asPERL6_EXCEPTIONS_HANDLER.RAKUDO_NO_DEPRECATIONS(Bool;src/core.c/Deprecations.pm6) β If true, suppresses deprecation warnings triggered by theis DEPRECATEDtrait.RAKUDO_DEPRECATIONS_FATAL(Bool;src/core.c/Deprecations.pm6) β If true, deprecation warnings become thrown exceptions. π yes, they jump you.RAKUDO_VERBOSE_STACKFRAME(UInt;src/core.c/Backtrace.pm6) β Displays source code in stack frames surrounded by the specified number of lines of context; for instanceRAKUDO_VERBOSE_STACKFRAME = 1will use one context line.RAKUDO_BACKTRACE_SETTING(Bool;src/core.c/Backtrace.pm6) β Controls whether.settingfiles are included in backtraces.
π Affecting precompilation π
RAKUDO_PREFIX(Str;src/core.c/CompUnit/RepositoryRegistry.pm6) β 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.RAKUDO_PRECOMP_DIST(src/core.c/CompUnit/PrecompilationRepository.pm6)RAKUDO_PRECOMP_LOADING(src/core.c/CompUnit/PrecompilationRepository.pm6)RAKUDO_PRECOMP_WITH(src/core.c/CompUnit/PrecompilationRepository.pm6)
These are internal variables for passing serialized state to precompilation jobs in child processes. Please do not set them manually. π«
RAKUDO_LOG_PRECOMPβ If set to1, diagnostic information about the precompilation process is emitted.
π¦ Line editor π¦
RAKUDO_LINE_EDITORβ This specifies the preferred line editor to use; valid values areReadline,Linenoise,LineEditor, andnone. A value ofnoneis useful if you want to avoid the recommendation message upon REPL startup.RAKUDO_DISABLE_MULTILINEβ If set to1, will disable multiline input for the REPL.RAKUDO_HISTβ This specifies the location of the history file used by the line editor; the default is~/.raku/rakudo-history. Before Rakudo version2020.02the default was~/.perl6/rakudo-history. If the older default file exists and the newer one does not, it will be automatically migrated. glow-up handled for you π
π Other π
RAKUDO_DEFAULT_READ_ELEMSβ This specifies the default number of characters to read on anIO::Handleby setting the$*DEFAULT-READ-ELEMSdynamic variable.RAKUDO_ERROR_COLOR(Bool;src/core.c/Exception.pm6) β Controls whether to emit ANSI codes for error highlighting. Defaults to true if unset, except on Windows.RAKUDO_MAX_THREADS(UInt;src/core.c/ThreadPoolScheduler.pm6) β Indicates the maximum number of threads used by default when creating aThreadPoolScheduler. Defaults to64.TMPDIR,TEMP,TMP(Str;src/core.c/IO/Spec/) β TheIO::Spec::Unix.tmpdirmethod will return$TMPDIRif it points to a directory with full access permissions for the current user, with a fallback default of/tmp.
IO::Spec::Cygwin and IO::Spec::Win32 use more Windows-appropriate lists which also include the %TEMP% and %TMP% environment variables.
PATH,Path(Str;src/core.c/IO/Spec/) β TheIO::Spec::Unix.pathmethod splits$PATHas a shell would; i.e. as a colon-separated list.IO::Spec::Cygwininherits this fromIO::Spec::Unix.IO::Spec::Win32.pathwill read the first defined of either%PATH%or%Path%as a semicolon-delimited list.RAKUDO_SNAPPERβ Indicates the period in which the telemetry snapper will take a snapshot. Defaults to.1for 10 snapshots per second.RAKUDO_HOMEβ Allows to override the Raku installation path. Defaults to[rakudo_executable_dir]/../share/perl6in relocatable builds and the absolute path to that folder in non-relocatable builds.NQP_HOMEβ Allows to override the NQP installation path. Defaults to[rakudo_executable_dir]/../share/nqpin relocatable builds and the absolute path to that folder in non-relocatable builds.
π WINDOWS PECULIARITIES π
π Non-console applications π
On Windows, programs are compiled to either be console applications or non-console applications. Console applications always open a console window. There is no straightforward way to suppress this window. that's just the vibe over there, we don't make the rules.
Rakudo provides a separate set of executables suffixed with a 'w' (rakuw.exe, rakudow.exe, ...) that are compiled as non-console applications. These do not spawn this console window. β¨
WARNING π¨ By default these non-console applications will silently swallow everything that is printed toSTDOUTandSTDERR. gone. deleted. not me losing all my output π
To receive the output of the program it suffices to redirect it externally:
rakuw.exe script.raku >stdout.txt 2>stderr.txt
there she is. redirect your way to freedom π«Ά
π AUTHORS π
Written by the Rakudo contributors, see the CREDITS file.
This manual page was written by Reini Urban, Moritz Lenz and the Rakudo contributors.
and finally, the little incantation tucked at the bottom of the source file, exactly as written:
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
okay that's the whole page, you ate it bestie π
the footer energy on this one is perl v5.40.1, dated 2026-02-11, and it lives as perl6(1) β User Contributed Perl Documentation. periodt. πΈπ¦π
π¦ where this page comes from
- ubuntu resolute: rakudo 2024.09-4build1 Β· Artistic-2.0
- ubuntu stonking: rakudo 2024.09-4build1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms