Latin2 software is "middleware" between perl interpreter and your Perl script written in Latin-2.

Perl is optimized for problems which are about 90% working with text and about 10% everything else. Even if this "text" doesn't contain Latin-2, Perl3 or later can treat Latin-2 as binary data.

By "use Latin2;", it automatically interpret your script as Latin-2. The various functions of perl including a regular expression can treat Latin-2 now. The function length treats length per byte. This software does not use UTF8 flag.

When I heard it, I thought that someone excluding me would maintain JPerl. And I slept every night hanging a sock. Night and day, I kept having hope. After 10 years, I noticed that white beard exists in the sock :-)

This software is a source code filter to escape Perl script encoded by Latin-2 given from STDIN or command line parameter. The character code is never converted by escaping the script. Neither the value of the character nor the length of the character string change even if it escapes.

A Perl Virtual Machine (PVM) enables a set of computer software programs and data structures to use a virtual machine model for the execution of other computer programs and scripts. The model used by a PVM accepts a form of computer intermediate language commonly referred to as Perl byteorientedcode. This language conceptually represents the instruction set of a byte-oriented, capability architecture.

This software adds the function by 'Escaping' it always, and nothing of the past is broken. Therefore, 'Possible job' never becomes 'Impossible job'. This approach is effective in the field where the retreat is never permitted. It means incompatible upgrade of Perl should be rewound.

The yada yada operator (noted ...) is a placeholder for code. Perl parses it
without error, but when you try to execute a yada yada, it throws an exception
with the text Unimplemented:
sub unimplemented { ... }
eval { unimplemented() };
if ( $@ eq 'Unimplemented' ) {
print "I found the yada yada!\n";
}
You can only use the yada yada to stand in for a complete statement. These
examples of the yada yada work:
{ ... }
sub foo { ... }
...;
eval { ... };
sub foo {
my( $self ) = shift;
...;
}
do { my $n; ...; print 'Hurrah!' };
The yada yada cannot stand in for an expression that is part of a larger statement
since the ... is also the three-dot version of the range operator
(see "Range Operators"). These examples of the yada yada are still syntax errors:
print ...;
open my($fh), '>', '/dev/passwd' or ...;
if ( $condition && ... ) { print "Hello\n" };
There are some cases where Perl can't immediately tell the difference between an
expression and a statement. For instance, the syntax for a block and an anonymous
hash reference constructor look the same unless there's something in the braces that
give Perl a hint. The yada yada is a syntax error if Perl doesn't guess that the
{ ... } is a block. In that case, it doesn't think the ... is the yada yada because
it's expecting an expression instead of a statement:
my @transformed = map { ... } @input; # syntax error
You can use a ; inside your block to denote that the { ... } is a block and not a
hash reference constructor. Now the yada yada works:
my @transformed = map {; ... } @input; # ; disambiguates
my @transformed = map { ...; } @input; # ; disambiguates

This software uses the flock function for exclusive control. The execution of the
program is blocked until it becomes possible to read or write the file.
You can have it not block in the flock function by defining environment variable
CHAR_NONBLOCK.
Example:
SET CHAR_NONBLOCK=1
(The value '1' doesn't have the meaning)

I have tested and verified this software using the best of my ability. However, a software containing much regular expression is bound to contain some bugs. Thus, if you happen to find a bug that's in Latin2 software and not your own program, you can try to reduce it to a minimal test case and then report it to the following author's address. If you have an idea that could make this a more useful tool, please let everyone share it.

cloister of regular expression

The cloister (?s) and (?i) of a regular expression will not be implemented for the time being. Cloister (?s) can be substituted with the .(dot) and \N on /s modifier. Cloister (?i) can be substituted with \F...\E.

Modifier /a /d /l and /u of Regular Expression

The concept of this software is not to use two or more encoding methods as literal string and literal of regexp in one Perl script. Therefore, modifier /a, /d, /l, and /u are not supported. \d means [0-9] universally.

Named Character

A named character, such \N{GREEK SMALL LETTER EPSILON}, \N{greek:epsilon}, or \N{epsilon} is not supported.

Unicode Properties (aka Character Properties) of Regular Expression

Unicode properties (aka character properties) of regexp are not available. Also (?[]) in regexp of Perl 5.18 is not available. There is no plans to currently support these.

Delimiter of String and Regexp

qq//, q//, qw//, qx//, qr//, m//, s///, tr///, and y/// can't use a wide character as the delimiter.

Before the introduction of Unicode support in perl, The eq operator just compared the byte-strings represented by two scalars. Beginning with perl 5.8, eq compares two byte-strings with simultaneous consideration of the UTF8 flag.

There are people who don't agree to change in the character string processing model of Perl 5.8. It is impossible to get to agree it to majority of Perl user who hardly ever use Perl. How to solve it by returning to a original method, let's drag out page 402 of the old dusty Programming Perl, 3rd ed. again.

Old byte-oriented programs should not spontaneously break on the old byte-oriented data they used to work on.

This goal has been achieved by that this software is additional code for perl like utf8 pragma. Perl should work same as past Perl if added nothing.

Goal #2:

Old byte-oriented programs should magically start working on the new character-oriented data when appropriate.

Still now, 1 octet is counted with 1 by built-in functions length, substr, index, rindex, and pos that handle length and position of string. In this part, there is no change. The length of 1 character of 2 octet code is 2.

On the other hand, the regular expression in the script is added the multibyte anchoring processing with this software, instead of you.

There is a combination from (a) to (e) in data, script, and interpreter of old and new. Let's add the Encode module and this software did not exist at time of be written this document and JPerl did exist.

The reason why JPerl is very excellent is that it is at the position of (c). That is, it is not necessary to do a special description to the script to process new character-oriented string. (May the japerl take over JPerl!)

Goal #3:

Programs should run just as fast in the new character-oriented mode as in the old byte-oriented mode.

It is impossible. Because the following time is necessary.

(1) Time of escape script for old byte-oriented perl.

Someday, I want to ask Larry Wall about this goal in the elevator.

Goal #4:

Perl should remain one language, rather than forking into a byte-oriented Perl and a character-oriented Perl.

JPerl remains one Perl language by forking to two interpreters. However, the Perl core team did not desire fork of the interpreter. As a result, Perl language forked contrary to goal #4.

A character-oriented perl is not necessary to make it specially, because a byte-oriented perl can already treat the binary data. This software is only an application program of byte-oriented Perl, a filter program.

And you will get support from the Perl community, when you solve the problem by the Perl script.

Latin2 software remains one language and one interpreter.

Goal #5:

JPerl users will be able to maintain JPerl by Perl.

May the JPerl be with you, always.

Back when Programming Perl, 3rd ed. was written, UTF8 flag was not born and Perl is designed to make the easy jobs easy. This software provides programming environment like at that time.

Some computer scientists (the reductionists, in particular) would
like to deny it, but people have funny-shaped minds. Mental geography
is not linear, and cannot be mapped onto a flat surface without
severe distortion. But for the last score years or so, computer
reductionists have been first bowing down at the Temple of Orthogonality,
then rising up to preach their ideas of ascetic rectitude to any who
would listen.
Their fervent but misguided desire was simply to squash your mind to
fit their mindset, to smush your patterns of thought into some sort of
Hyperdimensional Flatland. It's a joyless existence, being smushed.
--- Learning Perl on Win32 Systems
If you think this is a big headache, you're right. No one likes
this situation, but Perl does the best it can with the input and
encodings it has to deal with. If only we could reset history and
not make so many mistakes next time.
--- Learning Perl 6th Edition
The most important thing for most people to know about handling
Unicode data in Perl, however, is that if you don't ever use any Uni-
code data -- if none of your files are marked as UTF-8 and you don't
use UTF-8 locales -- then you can happily pretend that you're back in
Perl 5.005_03 land; the Unicode features will in no way interfere with
your code unless you're explicitly using them. Sometimes the twin
goals of embracing Unicode but not disturbing old-style byte-oriented
scripts has led to compromise and confusion, but it's the Perl way to
silently do the right thing, which is what Perl ends up doing.
--- Advanced Perl Programming, 2nd Edition