Tuesday, February 9, 2010

Perl 5.6 Vs 5.8

Perl 5.6.1 and Perl 5.8.x are not binary compatible (It means that user will have to download the source code in c and install it using their c development and build environment). Binary versions may be available directly from vendors such as RedHat or Ubuntu etc.

There are a few important differences to consider:
-------------------------------------------------

5.6.1:
- Smaller installation,
- Faster in some cases,
- Broken threading model,
- No unicode

5.8.x:
- Larger installation,
- Threading model mostly works,
- Has unicode support


Highlights In 5.8.0

- Better Unicode Support:
Unicode support has been much enhanced since 5.6, at all levels:
- now supports Unicode 3.2.0 (5.6.1 supports 3.0.1)
- at the language (and internals) level Unicode support is
now more ubiquitous and robust
- regular expressions now work with Unicode
- support for non-Latin encodings (such as the various
Chinese/Japanese/Korean encodings) through the Encode module

- New Threads Implementation:
A new multithreading implementation called interpreter threads,
or "ithreads" for short, is available, their use instead of the
old "5.005 threads" is strongly encouraged. The major difference
is that in ithreads any data sharing must be done explicitly.

- New IO Implementation:
the new PerlIO implementation is both a portable stdio implementation
(at the source code level) and a flexible new framework for richer
I/O behaviours

- Better Numeric Accuracy:
previous Perls relied on vendors' string-to-number and back
routines which in some cases proved to be too much trust
leading to nonportable and wrong behaviours

- 64-bit support:
64-bit support is now considered to be mature -- if your platform
supports 64-bit integers or address space, you can compile Perl to
use those

- Safe Signals:
in previous versions of Perl signals could corrupt Perl's internal state

- Many New Modules:
Digest::MD5, File::Temp, Filter::Simple, libnet, List::Util,
Memoize, MIME::Base64, Scalar::Util, Storable, Switch,
Test::More, Test::Simple, Text::Balanced, Tie::File, ...

- Extensive Regression Testing:
Perl has now almost six times as many tests as in 5.6,
and the code is test built daily on several platforms

Incompatibilities

- BINARY INCOMPATIBLE:
mainly because of the PerlIO introduction, Perl 5.8 is not
binary compatible with any earlier Perl release, XS MODULES
WILL HAVE TO BE RECOMPILED!

- AIX Dynaloading:
Perl uses now AIX dynaloading, instead of the older emulated
version, to be more compatible with other applications on AIX

- 64-bit Platforms No Longer Use Perl Malloc:
the Perl malloc seems to have various problems on platforms
with 64-bit addressing, therefore the default in these cases
is to use the native malloc

- Hashing Order Changed Once Again:
the function used in the implementation of hashes was changed
to a better one once again, but your code shouldn't be expecting
any particular key ordering

- Attributes For my Now Handled At Run-Time:
the attributes for my() are now run-time, as opposed to compile time

- REF(...) instead of SCALAR(...):
to be consistent with ref()'s results, references to references
now stringify as "REF(...)"

- Unicode Model Changed (no more "use utf8", almost)
In Perl 5.6 "Unicodeness" was lexically scoped to the operations;
in Perl 5.8 "Unicodeness" is bound to the data. The only remaining
use of "use utf8" is when the Perl script itself is written in the
UTF-8 encoding of Unicode.

- VMS: Socket Extension Dynamic, IEEE fp Default on Alpha
- the Socket extension is now dynamic rather than static, which may
cause problems in really old VMS installations
- the IEEE floating point is now the default format in OpenVMS Alpha,
see README.vms for reasons and other details

Nomenclature Change

- What the "Camel III" book called an "IO discipline"
is now called an "IO layer"

Deprecations

- dump():
the functionality of the dump command is now considered obsolete

- 5.005 threads are now to be considered deprecated;
the new "interpreter threads" implementation should be used instead

- Pseudohashes:
the user-visible implementation of pseudohashes is going to be removed
and replaced with something cleaner (also, the internal implementation
will have to go since it was found to slow down the overall hash access)

- Use of tainted data in exec LIST and system LIST:
now gives a warning, but will become fatal error in a future release

- tr///C, tr///U:
the interface was found to be a mistake, pack("C0", ...) and
pack("U0", ...) can be used instead

No comments: