Command-line options for the jperl command.
jperl [options] [program | -e 'command'] [arguments]-
-e 'command'- Execute command./jperl -e 'print "Hello\n"' -
-E 'command'- Execute command with all features enabled./jperl -E 'say "Hello"' # say requires -E
-
-c- Check syntax only (no execution)./jperl -c script.pl
-
-v- Print version./jperl -v
-
-hor-?- Show help./jperl -h
-
-I dir- Add directory to@INC(module search path)./jperl -I/path/to/lib script.pl
-
-M module- Load module (likeuse module)./jperl -MJSON -E 'say encode_json({a => 1})' -
-m module- Load module (likeuse module ())./jperl -mJSON script.pl
-
-n- Process input line-by-line (implicit loop, no print)echo -e "foo\nbar" | ./jperl -ne 'print if /foo/'
-
-p- Like-nbut print$_after each iterationecho -e "foo\nbar" | ./jperl -pe 's/foo/baz/'
-
-a- Autosplit mode (splits$_into@F)echo "a b c" | ./jperl -ane 'print "$F[1]\n"' # Prints: b
-
-F pattern- Split pattern for-a(default: whitespace)echo "a:b:c" | ./jperl -F: -ane 'print "$F[1]\n"' # Prints: b
-
-0[octal]- Input record separator (default: newline)# Read null-terminated records ./jperl -0 -ne 'print' file.txt # Read entire file as one record ./jperl -0777 -ne 'print length' file.txt
-
-l[octal]- Enable line ending processing# Auto-chomp and add newline to print ./jperl -lne 'print uc' file.txt
-
-i[extension]- Edit files in-place# In-place edit with backup ./jperl -i.bak -pe 's/foo/bar/g' file.txt # In-place edit without backup ./jperl -i -pe 's/foo/bar/g' file.txt
-s- Enable switch parsing for script# script.pl can access -foo as $foo ./jperl -s script.pl -foo=bar
-
-w- Enable warnings./jperl -w script.pl
-
-W- Enable all warnings./jperl -W script.pl
-
-X- Disable all warnings./jperl -X script.pl
-
-x[dir]- Extract script from message./jperl -x script.txt
-
-S- Search for script in PATH./jperl -S script.pl
-
-g- Read all input before executing (slurp mode for-n/-p)
-
--interpreter- Use interpreter mode instead of compiler mode./jperl --interpreter script.pl
Compiler mode (default) generates JVM bytecode for high performance:
- High performance after JIT warmup (~82M ops/sec)
- Better for long-running programs
- Full Java integration and optimization
Interpreter mode executes Perl bytecode directly in a register-based VM without generating JVM bytecode. It offers:
- Faster startup time (no JVM class generation overhead)
- Ideal for short-lived scripts and
eval STRING - Performance: ~47M ops/sec (1.75x slower than compiler, within 2-5x target)
-
--debug- Show debug information./jperl --debug -E 'say "test"' -
--disassemble- Show disassembled bytecode# Show JVM bytecode (compiler mode) ./jperl --disassemble script.pl # Show interpreter bytecode (interpreter mode) ./jperl --interpreter --disassemble script.pl
-
--tokenize- Show lexer output./jperl --tokenize -E '$x = 1' -
--parse- Show parser output (AST)./jperl --parse -E 'my $x = 1' -
-V- Print detailed configuration./jperl -V
-
PERL5LIB- Directories to add to@INCexport PERL5LIB=/path/to/lib ./jperl script.pl -
PERL5OPT- Default options for perlexport PERL5OPT='-Mwarnings -Mstrict' ./jperl script.pl
Options can be combined for powerful one-liners:
# Replace text in all files
./jperl -i.bak -pe 's/old/new/g' *.txt
# Process CSV with auto-split
./jperl -F, -ane 'print "$F[2]\n"' data.csv
# Count lines matching pattern
./jperl -ne 'END {print $.} /pattern/ or next' file.txt
# Sum numbers in a column
./jperl -ane '$sum += $F[2]; END {print $sum}' data.txt
# Use interpreter mode for quick scripts
./jperl --interpreter -E 'say "Hello, World!"'
# Debug interpreter bytecode
./jperl --interpreter --disassemble -E 'my $x = 1; $x += 2'The following standard Perl options are not yet implemented:
-T- Taint checks-t- Taint checks with warnings-u- Dumps core after compiling-U- Allows unsafe operations-d[t][:debugger]- Run under debugger-D[number/list]- Set debugging flags-C [number/list]- Control Unicode features
- Quick Start - Getting started guide
- One-liners - Practical examples
- Feature Matrix - Supported features