Perl as a target language: literal encoders, realizations, context wrappers and the probes behind every capability they rely on.
Exports data in exactly the shapes of grammar.realize and grammar.probe.
module bundles them for grammar.core/compose, and grammar.core/modules
includes it by default.
Strings are bytes. A Perl literal here denotes the UTF-8 bytes of the intent's string as a byte string (every char < 256, no utf8 flag), and every handle written to is binmode'd first, so no I/O layer (PERL_UNICODE, -C, a locale) can re-encode what is printed.
Capabilities (all probed through the shell, all needing :interp/perl):
:interp/perl perl -e runs a program from the PATH :pl/binmode binmode(STDOUT) makes STDOUT a raw byte stream :pl/print print(STDOUT ...) writes and reports success :pl/syswrite syswrite writes unbuffered and returns a byte count :pl/open-write 3-arg open(..., '>', path) creates/truncates a file :pl/sysopen Fcntl loads and sysopen(O_WRONLY|O_CREAT|O_TRUNC) works :pl/system system with a LIST runs a program (no shell) and waits
Perl as a target language: literal encoders, realizations, context wrappers and the probes behind every capability they rely on. Exports data in exactly the shapes of grammar.realize and grammar.probe. `module` bundles them for grammar.core/compose, and grammar.core/modules includes it by default. Strings are bytes. A Perl literal here denotes the UTF-8 bytes of the intent's string as a byte string (every char < 256, no utf8 flag), and every handle written to is binmode'd first, so no I/O layer (PERL_UNICODE, -C, a locale) can re-encode what is printed. Capabilities (all probed through the shell, all needing :interp/perl): :interp/perl perl -e runs a program from the PATH :pl/binmode binmode(STDOUT) makes STDOUT a raw byte stream :pl/print print(STDOUT ...) writes and reports success :pl/syswrite syswrite writes unbuffered and returns a byte count :pl/open-write 3-arg open(..., '>', path) creates/truncates a file :pl/sysopen Fcntl loads and sysopen(O_WRONLY|O_CREAT|O_TRUNC) works :pl/system system with a LIST runs a program (no shell) and waits
Perl as a grammar.core language module. Its parts are vars, so reloading this namespace is seen without reloading grammar.core. Its probes need :sh/single-quote, so it goes after the core module.
Perl as a grammar.core language module. Its parts are vars, so reloading this namespace is seen without reloading grammar.core. Its probes need :sh/single-quote, so it goes after the core module.
(perl-chr s)Perl expression with no quote characters at all: the UTF-8 bytes joined from chr. Carries NUL. The empty string is q().
Perl expression with no quote characters at all: the UTF-8 bytes joined from chr. Carries NUL. The empty string is q().
(perl-double s)Perl double-quoted literal of printable ASCII. Every byte that could interpolate or terminate ($ @ \ ") and every control or non-ASCII byte becomes \x{hh}, so NUL is fine and nothing interpolates.
Perl double-quoted literal of printable ASCII. Every byte that could
interpolate or terminate ($ @ \ ") and every control or non-ASCII byte
becomes \x{hh}, so NUL is fine and nothing interpolates.(perl-single s)Perl single-quoted literal of ASCII text. Nothing interpolates; only
and ' are escaped. nil when s holds:
use utf8, and the environment can turn that on
(PERL5OPT=-Mutf8), which would decode them into one char each.
perl-double's \x{hh} escapes stay bytes either way.Perl single-quoted literal of ASCII text. Nothing interpolates; only \
and ' are escaped. nil when s holds:
- NUL: program text travels as an argv word, which cannot carry one;
- CR LF: perl's lexer drops a CR before LF in program text, inside quotes
too, and a single-quoted string has no escape for CR;
- any non-ASCII char: raw UTF-8 source bytes are read as bytes only
without `use utf8`, and the environment can turn that on
(PERL5OPT=-Mutf8), which would decode them into one char each.
perl-double's \x{hh} escapes stay bytes either way.Shell scripts, single-quoted perl inside. Run after grammar.probe/probes (:sh/single-quote is probed there); every :pl/ probe needs :interp/perl, so with perl absent they are skipped and stay :unknown.
Shell scripts, single-quoted perl inside. Run after grammar.probe/probes (:sh/single-quote is probed there); every :pl/ probe needs :interp/perl, so with perl absent they are skipped and stay :unknown.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |