v3.1.0: More Perl, More Flexibility, Better Compatibility
This release brings PerlOnJava even closer to full Perl 5 compatibility with dozens of new features and bugfixes. It adds powerful operators, enhances I/O capabilities, improves interactivity, and extends module support, making the experience more Perl-like than ever on the JVM.
🚀 Highlights
🆕 Perl 5.42.0 Compatibility
PerlOnJava now targets Perl 5.42.0, bringing in modern language enhancements and keeping up with the latest syntax changes. This includes support for the new built-in keywords all
and any
, offering concise and readable alternatives for common list operations.
🔡 Multiple Input Modes
You can now run Perl code using several input formats:
- Pipe:
echo 'print "Hello\n"' | ./jperl
- Interactive shell:
./jperl
prompts for input (pressCtrl+D
orCtrl+Z
to finish) - File redirection:
./jperl < script.pl
- Arguments:
./jperl -e 'print "Hello\n"'
or./jperl script.pl
🧠 Smarter Operators and Overloading
Overloading support has expanded dramatically, now including:
- Arithmetic and math functions:
+
,-
,*
,/
,%
,int
,neg
,log
,sqrt
,cos
,sin
,exp
,abs
,**
,atan2
- Dereferencing types:
@{}
,%{}
,${}
,&{}
,*{}
- Logical operators:
!
🧪 Subroutine Prototypes: Fully Implemented
Support now covers all major prototype features, including +
, ;
, *
, \@
, \%
, \$
, and more complex types like \[@%]
.
🧰 Expanded Built-ins and Operators
Newly supported Perl built-ins include:
- File and I/O:
read
,tell
,seek
,system
,exec
,sysopen
,chmod
- Xor assignment:
^^=
- Array index handling:
delete
,exists
- Timeout-ready
select
:select(undef,undef,undef,$time)
- Lvalue support for
$#array
🗃️ Better File Handling
- In-memory files are now supported via
open
. - Pipe syntax like
-|
,|-
,ls|
,|sort
works. - Full I/O layer support:
:raw
,:bytes
,:crlf
,:utf8
,:unix
,:encoding(...)
.
📦 New Modules and Features
- Modules:
Fcntl
,Test
,Text::CSV
- Test::More: new functions
subtest
,use_ok
,require_ok
- CORE:: functions now match native Perl prototypes
- Double-quoted string escapes: added
\U
,\L
,\u
,\l
- Pack/unpack: added
C*
star-count syntax
🧠 Syntax and Semantics
- Identifiers starting with
::
are now correctly parsed in themain::
package. # line
directive is supported for preprocessing tools.- Improved autovivification logic distinguishes between contexts where undefined refs should create data structures vs. throw errors.
🐞 Bug Fixes and Developer Tools
- Fixed newline handling and
qw()
issues on Windows - Fixed
mkdir
behavior on Windows - Fixed list context in certain operators
- Corrected operator overriding rules
- Fixed a regression:
-E
was wrongly enablingstrict
🧱 Developer & Packaging Updates
- Makefile now included
- Debian package can be built via
make deb
PerlOnJava 3.1.0 is a major step toward seamless Perl execution on the JVM. It expands what's possible with embedded Perl, testing, and dynamic scripting, all while staying true to the Perl ethos.
Explore the project: https://github.com/fglock/PerlOnJava