++ed by:

100 PAUSE users
209 non-PAUSE users.

Gurusamy Sarathy


perldelta - what's new for perl5.006 (as of 5.005_54)


This document describes differences between the 5.005 release and this one.

Incompatible Changes

Perl Source Incompatibilities

None known at this time.

C Source Incompatibilities


Release 5.005 grandfathered old global symbol names by providing preprocessor macros for extension source compatibility. As of release 5.006, these preprocessor definitions are not available by default. You need to explicitly compile perl with -DPERL_POLLUTE in order to get these definitions.


Enabling the use of Perl's malloc in release 5.005 and earlier caused the namespace of system versions of the malloc family of functions to be usurped by the Perl versions of these functions, since they used the same names by default.

Besides causing problems on platforms that do not allow these functions to be cleanly replaced, this also meant that the system versions could not be called in programs that used Perl's malloc. Previous versions of Perl have allowed this behavior to be suppressed with the HIDEMYMALLOC and EMBEDMYMALLOC preprocessor definitions.

As of release 5.006, Perl's malloc family of functions have default names distinct from the system versions. You need to explicitly compile perl with -DPERL_POLLUTE_MALLOC in order to get the older behavior. HIDEMYMALLOC and EMBEDMYMALLOC have no effect, since the behavior they enabled is now the default.

Note that these functions do not constitute Perl's memory allocation API. See "Memory Allocation" in perlguts for further information about that.

PL_na and dTHR Issues

The PL_na global is now thread local, so a dTHR declaration is needed in the scope in which it appears. XSUBs should handle this automatically, but if you have used PL_na in support functions, you either need to change the PL_na to a local variable (which is recommended), or put in a dTHR.

Compatible C Source API Changes


The cpp macros PERL_REVISION, PERL_VERSION and PERL_SUBVERSION are now available by default from perl.h, and reflect the base revision, patchlevel and subversion respectively. PERL_REVISION had no prior equivalent, while PERL_VERSION and PERL_SUBVERSION were previously available as PATCHLEVEL and SUBVERSION.

The new names cause less pollution of the cpp namespace, and reflect what the numbers have come to stand for in common practice. For compatibility, the old names are still supported when patchlevel.h is explicitly included (as required before), so there is no source incompatibility due to the change.

Binary Incompatibilities

This release is not binary compatible with the 5.005 release and its maintenance versions.

Core Changes

Binary numbers supported

Binary numbers are now supported as literals, in s?printf formats, and oct():

        $answer = 0b101010;
        printf "The answer is: %b\n", oct("0b101010");

syswrite() ease-of-use

The length argument of syswrite() is now optional.

64-bit support

Better 64-bit support -- but full support still a distant goal. One must Configure with -Duse64bits to get Configure to probe for the extent of 64-bit support. Depending on the platform (hints file) more or less 64-awareness becomes available. As of 5.005_54 at least somewhat 64-bit aware platforms are HP-UX 11 or better, Solaris 2.6 or better, IRIX 6.2 or better. Naturally 64-bit platforms like Digital UNIX and UNICOS also have 64-bit support.

Better syntax checks on parenthesized unary operators

Expressions such as:

        print defined(&foo,&bar,&baz);
        print uc("foo","bar","baz");

used to be accidentally allowed in earlier versions, and produced unpredictable behavior. Some of them produced ancillary warnings when used in this way, while others silently did the wrong thing.

The parenthesized forms of most unary operators that expect a single argument will now ensure that they are not called with more than one argument, making the above cases syntax errors. Note that the usual behavior of:

        print defined &foo, &bar, &baz;
        print uc "foo", "bar", "baz";
        undef $foo, &bar;

remains unchanged. See perlop.

Improved qw// operator

The qw// operator is now evaluated at compile time into a true list instead of being replaced with a run time call to split(). This removes the confusing behavior of qw// in scalar context stemming from the older implementation, which inherited the behavior from split().


    $foo = ($bar) = qw(a b c); print "$foo|$bar\n";

now correctly prints "3|a", instead of "2|a".

pack() format 'Z' supported

The new format type 'Z' is useful for packing and unpacking null-terminated strings. See "pack" in perlfunc.

Significant bug fixes

<HANDLE> on empty files

With $/ set to undef, slurping an empty file returns a string of zero length (instead of undef, as it used to) for the first time the HANDLE is read. Subsequent reads yield undef.

This means that the following will append "foo" to an empty file (it used to not do anything before):

    perl -0777 -pi -e 's/^/foo/' empty_file

Note that the behavior of:

    perl -pi -e 's/^/foo/' empty_file

is unchanged (it continues to leave the file empty).

pack() format modifier '_' supported

The new format type modifer '_' is useful for packing and unpacking native shorts, ints, and longs. See "pack" in perlfunc.

Supported Platforms

  • VM/ESA is now supported.

  • Siemens BS200 is now supported.

  • The Mach CThreads (NeXTstep) are now supported by the Thread extension.

New tests


IO constants (SEEK_*, _IO*).


Directory-related IO methods (new, read, close, rewind, tied delete).


INET sockets with multi-homed hosts.


IO poll().


UNIX sockets.


File test operators.


Verify operations that access pad objects (lexicals and temporaries).

Modules and Pragmata



Added Dumpvalue module provides screen dumps of Perl data.


You can now run tests for x seconds instead of guessing the right number of tests to run.


More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for large (more than 4G) file access (the 64-bit support is not yet working, though, so no need to get overly excited), Free/Net/OpenBSD locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and O_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR.


The accessors methods Re, Im, arg, abs, rho, theta, methods can ($z->Re()) now also act as mutators ($z->Re(3)).


A little bit of radial trigonometry (cylindrical and spherical) added, for example the great circle distance.


The timelocal() and timegm() functions used to silently return bogus results when the date exceeded the machine's integer range. They consistently croak() if the date falls in an unsupported range.


Lexical warnings pragma, "use warning;", to control optional warnings.

Filetest pragma, to control the behaviour of filetests (-r -w ...). Currently only one subpragma implemented, "use filetest 'access';", that enables the use of access(2) or equivalent to check the permissions instead of using stat(2) as usual. This matters in filesystems where there are ACLs (access control lists), the stat(2) might lie, while access(2) knows better.

Utility Changes


Documentation Changes


A tutorial on using open() effectively.


A tutorial that introduces the essentials of references.

New Diagnostics

/%s/: Unrecognized escape \\%c passed through

(W) You used a backslash-character combination which is not recognized by Perl. This combination appears in an interpolated variable or a '-delimited regular expression.

Unrecognized escape \\%c passed through

(W) You used a backslash-character combination which is not recognized by Perl.

Missing command in piped open

(W) You used the open(FH, "| command") or open(FH, "command |") construction, but the command was missing or blank.

Obsolete Diagnostics


Configuration Changes

You can use "Configure -Uinstallusrbinperl" which causes installperl to skip installing perl also as /usr/bin/perl. This is useful if you prefer not to modify /usr/bin for some reason or another but harmful because many scripts assume to find Perl in /usr/bin/perl.


If you find what you think is a bug, you might check the headers of recently posted articles in the comp.lang.perl.misc newsgroup. There may also be information at http://www.perl.com/perl/, the Perl Home Page.

If you believe you have an unreported bug, please run the perlbug program included with your release. Make sure you trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of perl -V, will be sent off to <perlbug@perl.com> to be analysed by the Perl porting team.


The Changes file for exhaustive details on what changed.

The INSTALL file for how to build Perl.

The README file for general stuff.

The Artistic and Copying files for copyright information.


Written by Gurusamy Sarathy <gsar@umich.edu>, with many contributions from The Perl Porters.

Send omissions or corrections to <perlbug@perl.com>.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 296:

'=item' outside of any '=over'

Around line 312:

You forgot a '=back' before '=head1'