Cari di Perl 
    Perl Tutorial
Daftar Isi
(Sebelumnya) What is new for perl v5.8.0What's new for perl v5.6.0 (Berikutnya)
History-Changes

What's new for perl v5.6.1

Daftar Isi

NAME

perl561delta - what's new for perl v5.6.1

DESCRIPTION

This document describes differences between the 5.005 release and the 5.6.1release.

Summary of changes between 5.6.0 and 5.6.1

This section contains a summary of the changes between the 5.6.0 releaseand the 5.6.1 release. More details about the changes mentioned heremay be found in the Changes files that accompany the Perl sourcedistribution. See perlhack for pointers to online resources where youcan inspect the individual patches described by these changes.

Security Issues

suidperl will not run /bin/mail anymore, because some platforms havea /bin/mail that is vulnerable to buffer overflow attacks.

Note that suidperl is neither built nor installed by default inany recent version of perl. Use of suidperl is highly discouraged.If you think you need it, try alternatives such as sudo first.See http://www.courtesan.com/sudo/ .

Core bug fixes

This is not an exhaustive list. It is intended to cover only thesignificant user-visible changes.

  • UNIVERSAL::isa()

    A bug in the caching mechanism used by UNIVERSAL::isa() that affectedbase.pm has been fixed. The bug has existed since the 5.005 releases,but wasn't tickled by base.pm in those releases.

  • Memory leaks

    Various cases of memory leaks and attempts to access uninitialized memoryhave been cured. See Known Problems below for further issues.

  • Numeric conversions

    Numeric conversions did not recognize changes in the string valueproperly in certain circumstances.

    In other situations, large unsigned numbers (those above 2**31) couldsometimes lose their unsignedness, causing bogus results in arithmeticoperations.

    Integer modulus on large unsigned integers sometimes returnedincorrect values.

    Perl 5.6.0 generated "not a number" warnings on certain conversions whereprevious versions didn't.

    These problems have all been rectified.

    Infinity is now recognized as a number.

  • qw(a\b)

    In Perl 5.6.0, qw(a\b) produced a string with two backslashes insteadof one, in a departure from the behavior in previous versions. Theolder behavior has been reinstated.

  • caller()

    caller() could cause core dumps in certain situations. Carp was sometimesaffected by this problem.

  • Bugs in regular expressions

    Pattern matches on overloaded values are now handled correctly.

    Perl 5.6.0 parsed m/\x{ab}/ incorrectly, leading to spurious warnings.This has been corrected.

    The RE engine found in Perl 5.6.0 accidentally pessimised certain kindsof simple pattern matches. These are now handled better.

    Regular expression debug output (whether through use re 'debug'or via -Dr) now looks better.

    Multi-line matches like "a\nxb\n" =~ /(?!\A)x/m were flawed. Thebug has been fixed.

    Use of $& could trigger a core dump under some situations. Thisis now avoided.

    Match variables $1 et al., weren't being unset when a pattern matchwas backtracking, and the anomaly showed up inside /...(?{ ... }).../etc. These variables are now tracked correctly.

    pos() did not return the correct value within s///ge in earlierversions. This is now handled correctly.

  • "slurp" mode

    readline() on files opened in "slurp" mode could return an extra "" atthe end in certain situations. This has been corrected.

  • Autovivification of symbolic references to special variables

    Autovivification of symbolic references of special variables describedin perlvar (as in ${$num}) was accidentally disabled. This worksagain now.

  • Lexical warnings

    Lexical warnings now propagate correctly into eval "...".

    use warnings qw(FATAL all) did not work as intended. This has beencorrected.

    Lexical warnings could leak into other scopes in some situations.This is now fixed.

    warnings::enabled() now reports the state of $^W correctly if the callerisn't using lexical warnings.

  • Spurious warnings and errors

    Perl 5.6.0 could emit spurious warnings about redefinition of dl_error()when statically building extensions into perl. This has been corrected.

    "our" variables could result in bogus "Variable will not stay shared"warnings. This is now fixed.

    "our" variables of the same name declared in two sibling blocksresulted in bogus warnings about "redeclaration" of the variables.The problem has been corrected.

  • glob()

    Compatibility of the builtin glob() with old csh-based glob has beenimproved with the addition of GLOB_ALPHASORT option. See File::Glob.

    File::Glob::glob() has been renamed to File::Glob::bsd_glob()because the name clashes with the builtin glob(). The oldername is still available for compatibility, but is deprecated.

    Spurious syntax errors generated in certain situations, when glob()caused File::Glob to be loaded for the first time, have been fixed.

  • Tainting

    Some cases of inconsistent taint propagation (such as within hashvalues) have been fixed.

    The tainting behavior of sprintf() has been rationalized. It doesnot taint the result of floating point formats anymore, making thebehavior consistent with that of string interpolation.

  • sort()

    Arguments to sort() weren't being provided the right wantarray() context.The comparison block is now run in scalar context, and the arguments tobe sorted are always provided list context.

    sort() is also fully reentrant, in the sense that the sort functioncan itself call sort(). This did not work reliably in previous releases.

  • #line directives

    #line directives now work correctly when they appear at the verybeginning of eval "...".

  • Subroutine prototypes

    The (\&) prototype now works properly.

  • map()

    map() could get pathologically slow when the result list it generatesis larger than the source list. The performance has been improved forcommon scenarios.

  • Debugger

    Debugger exit code now reflects the script exit code.

    Condition "0" in breakpoints is now treated correctly.

    The d command now checks the line number.

    $. is no longer corrupted by the debugger.

    All debugger output now correctly goes to the socket if RemotePortis set.

  • PERL5OPT

    PERL5OPT can be set to more than one switch group. Previously,it used to be limited to one group of options only.

  • chop()

    chop(@list) in list context returned the characters chopped in reverseorder. This has been reversed to be in the right order.

  • Unicode support

    Unicode support has seen a large number of incremental improvements,but continues to be highly experimental. It is not expected to befully supported in the 5.6.x maintenance releases.

    substr(), join(), repeat(), reverse(), quotemeta() and stringconcatenation were all handling Unicode strings incorrectly inPerl 5.6.0. This has been corrected.

    Support for tr///CU and tr///UC etc., have been removed sincewe realized the interface is broken. For similar functionality,see pack.

    The Unicode Character Database has been updated to version 3.0.1with additions made available to the public as of August 30, 2000.

    The Unicode character classes \p{Blank} and \p{SpacePerl} have beenadded. "Blank" is like C isblank(), that is, it contains only"horizontal whitespace" (the space character is, the newline isn't),and the "SpacePerl" is the Unicode equivalent of \s (\p{Space}isn't, since that includes the vertical tabulator character, whereas\s doesn't.)

    If you are experimenting with Unicode support in perl, the developmentversions of Perl may have more to offer. In particular, I/O layersare now available in the development track, but not in the maintenancetrack, primarily to do backward compatibility issues. Unicode supportis also evolving rapidly on a daily basis in the development track--themaintenance track only reflects the most conservative of these changes.

  • 64-bit support

    Support for 64-bit platforms has been improved, but continues to beexperimental. The level of support varies greatly among platforms.

  • Compiler

    The B Compiler and its various backends have had many incrementalimprovements, but they continue to remain highly experimental. Use inproduction environments is discouraged.

    The perlcc tool has been rewritten so that the user interface is muchmore like that of a C compiler.

    The perlbc tools has been removed. Use perlcc -B instead.

  • Lvalue subroutines

    There have been various bugfixes to support lvalue subroutines better.However, the feature still remains experimental.

  • IO::Socket

    IO::Socket::INET failed to open the specified port if the servicename was not known. It now correctly uses the supplied port numberas is.

  • File::Find

    File::Find now chdir()s correctly when chasing symbolic links.

  • xsubpp

    xsubpp now tolerates embedded POD sections.

  • no Module;

    no Module; does not produce an error even if Module does not have anunimport() method. This parallels the behavior of use vis-a-visimport.

  • Tests

    A large number of tests have been added.

Core features

untie() will now call an UNTIE() hook if it exists. See perltiefor details.

The -DT command line switch outputs copious tokenizing information.See perlrun.

Arrays are now always interpolated in double-quotish strings. Previously,"[email protected]" used to be a fatal error at compile time, if an array@bar was not used or declared. This transitional behavior wasintended to help migrate perl4 code, and is deemed to be no longer useful.See Arrays now always interpolate into double-quoted strings.

keys(), each(), pop(), push(), shift(), splice() and unshift()can all be overridden now.

my __PACKAGE__ $obj now does the expected thing.

Configuration issues

On some systems (IRIX and Solaris among them) the system malloc is demonstrablybetter. While the defaults haven't been changed in order to retain binarycompatibility with earlier releases, you may be better off building perlwith Configure -Uusemymalloc ... as discussed in the INSTALL file.

Configure has been enhanced in various ways:

  • Minimizes use of temporary files.

  • By default, does not link perl with libraries not used by it, such asthe various dbm libraries. SunOS 4.x hints preserve behavior on thatplatform.

  • Support for pdp11-style memory models has been removed due to obsolescence.

  • Building outside the source tree is supported on systems that havesymbolic links. This is done by running

    1. sh /path/to/source/Configure -Dmksymlinks ...
    2. make all test install

    in a directory other than the perl source directory. See INSTALL.

  • Configure -S can be run non-interactively.

Documentation

README.aix, README.solaris and README.macos have been added.README.posix-bc has been renamed to README.bs2000. These areinstalled as perlaix, perlsolaris, perlmacos, andperlbs2000 respectively.

The following pod documents are brand new:

  1. perlclibInternal replacements for standard C library functions
  2. perldebtutPerl debugging tutorial
  3. perlebcdicConsiderations for running Perl on EBCDIC platforms
  4. perlnewmodPerl modules: preparing a new module for distribution
  5. perlrequickPerl regular expressions quick start
  6. perlretutPerl regular expressions tutorial
  7. perlutilutilities packaged with the Perl distribution

The INSTALL file has been expanded to cover various issues, such as64-bit support.

A longer list of contributors has been added to the source distribution.See the file AUTHORS.

Numerous other changes have been made to the included documentation and FAQs.

Bundled modules

The following modules have been added.

  • B::Concise

    Walks Perl syntax tree, printing concise info about ops. See B::Concise.

  • File::Temp

    Returns name and handle of a temporary file safely. See File::Temp.

  • Pod::LaTeX

    Converts Pod data to formatted LaTeX. See Pod::LaTeX.

  • Pod::Text::Overstrike

    Converts POD data to formatted overstrike text. See Pod::Text::Overstrike.

The following modules have been upgraded.

  • CGI

    CGI v2.752 is now included.

  • CPAN

    CPAN v1.59_54 is now included.

  • Class::Struct

    Various bugfixes have been added.

  • DB_File

    DB_File v1.75 supports newer Berkeley DB versions, among otherimprovements.

  • Devel::Peek

    Devel::Peek has been enhanced to support dumping of memory statistics,when perl is built with the included malloc().

  • File::Find

    File::Find now supports pre and post-processing of the files in orderto sort() them, etc.

  • Getopt::Long

    Getopt::Long v2.25 is included.

  • IO::Poll

    Various bug fixes have been included.

  • IPC::Open3

    IPC::Open3 allows use of numeric file descriptors.

  • Math::BigFloat

    The fmod() function supports modulus operations. Various bug fixeshave also been included.

  • Math::Complex

    Math::Complex handles inf, NaN etc., better.

  • Net::Ping

    ping() could fail on odd number of data bytes, and when the echo serviceisn't running. This has been corrected.

  • Opcode

    A memory leak has been fixed.

  • Pod::Parser

    Version 1.13 of the Pod::Parser suite is included.

  • Pod::Text

    Pod::Text and related modules have been upgraded to the versionsin podlators suite v2.08.

  • SDBM_File

    On dosish platforms, some keys went missing because of lack of support forfiles with "holes". A workaround for the problem has been added.

  • Sys::Syslog

    Various bug fixes have been included.

  • Tie::RefHash

    Now supports Tie::RefHash::Nestable to automagically tie hashref values.

  • Tie::SubstrHash

    Various bug fixes have been included.

Platform-specific improvements

The following new ports are now available.

  • NCR MP-RAS
  • NonStop-UX

Perl now builds under Amdahl UTS.

Perl has also been verified to build under Amiga OS.

Support for EPOC has been much improved. See README.epoc.

Building perl with -Duseithreads or -Duse5005threads now worksunder HP-UX 10.20 (previously it only worked under 10.30 or later).You will need a thread library package installed. See README.hpux.

Long doubles should now work under Linux.

Mac OS Classic is now supported in the mainstream source package.See README.macos.

Support for MPE/iX has been updated. See README.mpeix.

Support for OS/2 has been improved. See os2/Changes and README.os2.

Dynamic loading on z/OS (formerly OS/390) has been improved. SeeREADME.os390.

Support for VMS has seen many incremental improvements, includingbetter support for operators like backticks and system(), and better%ENV handling. See README.vms and perlvms.

Support for Stratus VOS has been improved. See vos/Changes and README.vos.

Support for Windows has been improved.

  • fork() emulation has been improved in various ways, but still continuesto be experimental. See perlfork for known bugs and caveats.

  • %SIG has been enabled under USE_ITHREADS, but its use is completelyunsupported under all configurations.

  • Borland C++ v5.5 is now a supported compiler that can build Perl.However, the generated binaries continue to be incompatible with thosegenerated by the other supported compilers (GCC and Visual C++).

  • Non-blocking waits for child processes (or pseudo-processes) aresupported via waitpid($pid, &POSIX::WNOHANG).

  • A memory leak in accept() has been fixed.

  • wait(), waitpid() and backticks now return the correct exit status underWindows 9x.

  • Trailing new %ENV entries weren't propagated to child processes. Thisis now fixed.

  • Current directory entries in %ENV are now correctly propagated to childprocesses.

  • Duping socket handles with open(F, ">&MYSOCK") now works under Windows 9x.

  • The makefiles now provide a single switch to bulk-enable all the featuresenabled in ActiveState ActivePerl (a popular binary distribution).

  • Win32::GetCwd() correctly returns C:\ instead of C: when at the drive root.Other bugs in chdir() and Cwd::cwd() have also been fixed.

  • fork() correctly returns undef and sets EAGAIN when it runs out ofpseudo-process handles.

  • ExtUtils::MakeMaker now uses $ENV{LIB} to search for libraries.

  • UNC path handling is better when perl is built to support fork().

  • A handle leak in socket handling has been fixed.

  • send() works from within a pseudo-process.

Unless specifically qualified otherwise, the remainder of this documentcovers changes between the 5.005 and 5.6.0 releases.

Core Enhancements

Interpreter cloning, threads, and concurrency

Perl 5.6.0 introduces the beginnings of support for running multipleinterpreters concurrently in different threads. In conjunction withthe perl_clone() API call, which can be used to selectively duplicatethe state of any given interpreter, it is possible to compile apiece of code once in an interpreter, clone that interpreterone or more times, and run all the resulting interpreters in distinctthreads.

On the Windows platform, this feature is used to emulate fork() at theinterpreter level. See perlfork for details about that.

This feature is still in evolution. It is eventually meant to be usedto selectively clone a subroutine and data reachable from thatsubroutine in a separate interpreter and run the cloned subroutinein a separate thread. Since there is no shared data between theinterpreters, little or no locking will be needed (unless parts ofthe symbol table are explicitly shared). This is obviously intendedto be an easy-to-use replacement for the existing threads support.

Support for cloning interpreters and interpreter concurrency can beenabled using the -Dusethreads Configure option (see win32/Makefile forhow to enable it on Windows.) The resulting perl executable will befunctionally identical to one that was built with -Dmultiplicity, butthe perl_clone() API call will only be available in the former.

-Dusethreads enables the cpp macro USE_ITHREADS by default, which in turnenables Perl source code changes that provide a clear separation betweenthe op tree and the data it operates with. The former is immutable, andcan therefore be shared between an interpreter and all of its clones,while the latter is considered local to each interpreter, and is thereforecopied for each clone.

Note that building Perl with the -Dusemultiplicity Configure optionis adequate if you wish to run multiple independent interpretersconcurrently in different threads. -Dusethreads only provides theadditional functionality of the perl_clone() API call and othersupport for running cloned interpreters concurrently.

  1. NOTE: This is an experimental feature. Implementation details are
  2. subject to change.

Lexically scoped warning categories

You can now control the granularity of warnings emitted by perl at a finerlevel using the use warnings pragma. warnings and perllexwarnhave copious documentation on this feature.

Unicode and UTF-8 support

Perl now uses UTF-8 as its internal representation for characterstrings. The utf8 and bytes pragmas are used to control this supportin the current lexical scope. See perlunicode, utf8 and bytes formore information.

This feature is expected to evolve quickly to support some form of I/Odisciplines that can be used to specify the kind of input and output data(bytes or characters). Until that happens, additional modules from CPANwill be needed to complete the toolkit for dealing with Unicode.

  1. NOTE: This should be considered an experimental feature. Implementation
  2. details are subject to change.

Support for interpolating named characters

The new \N escape interpolates named characters within strings.For example, "Hi! \N{WHITE SMILING FACE}" evaluates to a stringwith a Unicode smiley face at the end.

"our" declarations

An "our" declaration introduces a value that can be best understoodas a lexically scoped symbolic alias to a global variable in thepackage that was current where the variable was declared. This ismostly useful as an alternative to the vars pragma, but also providesthe opportunity to introduce typing and other attributes for suchvariables. See our.

Support for strings represented as a vector of ordinals

Literals of the form v1.2.3.4 are now parsed as a string composedof characters with the specified ordinals. This is an alternative, morereadable way to construct (possibly Unicode) strings instead ofinterpolating characters, as in "\x{1}\x{2}\x{3}\x{4}". The leadingv may be omitted if there are more than two ordinals, so 1.2.3 isparsed the same as v1.2.3.

Strings written in this form are also useful to represent version "numbers".It is easy to compare such version "numbers" (which are really just plainstrings) using any of the usual string comparison operators eq, ne,lt, gt, etc., or perform bitwise string operations on them using |,&, etc.

In conjunction with the new $^V magic variable (which containsthe perl version as a string), such literals can be used as a readable wayto check if you're running a particular version of Perl:

  1. # this will parse in older versions of Perl also
  2. if ($^V and $^V gt v5.6.0) {
  3. # new features supported
  4. }

require and use also have some special magic to support such literals.They will be interpreted as a version rather than as a module name:

  1. require v5.6.0;# croak if $^V lt v5.6.0
  2. use v5.6.0;# same, but croaks at compile-time

Alternatively, the v may be omitted if there is more than one dot:

  1. require 5.6.0;
  2. use 5.6.0;

Also, sprintf and printf support the Perl-specific format flag %vto print ordinals of characters in arbitrary strings:

  1. printf "v%vd", $^V;# prints current version, such as "v5.5.650"
  2. printf "%*vX", ":", $addr;# formats IPv6 address
  3. printf "%*vb", " ", $bits;# displays bitstring

See Scalar value constructors in perldata for additional information.

Improved Perl version numbering system

Beginning with Perl version 5.6.0, the version number convention has beenchanged to a "dotted integer" scheme that is more commonly found in opensource projects.

Maintenance versions of v5.6.0 will be released as v5.6.1, v5.6.2 etc.The next development series following v5.6.0 will be numbered v5.7.x,beginning with v5.7.0, and the next major production release followingv5.6.0 will be v5.8.0.

The English module now sets $PERL_VERSION to $^V (a string value) ratherthan $] (a numeric value). (This is a potential incompatibility.Send us a report via perlbug if you are affected by this.)

The v1.2.3 syntax is also now legal in Perl.See Support for strings represented as a vector of ordinals for more on that.

To cope with the new versioning system's use of at least three significantdigits for each version component, the method used for incrementing thesubversion number has also changed slightly. We assume that versions olderthan v5.6.0 have been incrementing the subversion component in multiples of10. Versions after v5.6.0 will increment them by 1. Thus, using the newnotation, 5.005_03 is the "same" as v5.5.30, and the first maintenanceversion following v5.6.0 will be v5.6.1 (which should be read as beingequivalent to a floating point value of 5.006_001 in the older format,stored in $]).

New syntax for declaring subroutine attributes

Formerly, if you wanted to mark a subroutine as being a method call oras requiring an automatic lock() when it is entered, you had to declarethat with a use attrs pragma in the body of the subroutine.That can now be accomplished with declaration syntax, like this:

  1. sub mymethod : locked method;
  2. ...
  3. sub mymethod : locked method {
  4. ...
  5. }
  6. sub othermethod :locked :method;
  7. ...
  8. sub othermethod :locked :method {
  9. ...
  10. }

(Note how only the first : is mandatory, and whitespace surroundingthe : is optional.)

AutoSplit.pm and SelfLoader.pm have been updated to keep the attributeswith the stubs they provide. See attributes.

File and directory handles can be autovivified

Similar to how constructs such as $x->[0] autovivify a reference,handle constructors (open(), opendir(), pipe(), socketpair(), sysopen(),socket(), and accept()) now autovivify a file or directory handleif the handle passed to them is an uninitialized scalar variable. Thisallows the constructs such as open(my $fh, ...) and open(local $fh,...)to be used to create filehandles that will conveniently be closedautomatically when the scope ends, provided there are no other referencesto them. This largely eliminates the need for typeglobs when openingfilehandles that must be passed around, as in the following example:

  1. sub myopen {
  2. open my $fh, "@_"
  3. or die "Can't open '@_': $!";
  4. return $fh;
  5. }
  6. {
  7. my $f = myopen("</etc/motd");
  8. print <$f>;
  9. # $f implicitly closed here
  10. }

open() with more than two arguments

If open() is passed three arguments instead of two, the second argumentis used as the mode and the third argument is taken to be the file name.This is primarily useful for protecting against unintended magic behaviorof the traditional two-argument form. See open.

64-bit support

Any platform that has 64-bit integers either

  1. (1) natively as longs or ints
  2. (2) via special compiler flags
  3. (3) using long long or int64_t

is able to use "quads" (64-bit integers) as follows:

  • constants (decimal, hexadecimal, octal, binary) in the code

  • arguments to oct() and hex()

  • arguments to print(), printf() and sprintf() (flag prefixes ll, L, q)

  • printed as such

  • pack() and unpack() "q" and "Q" formats

  • in basic arithmetics: + - * / % (NOTE: operating close to the limitsof the integer values may produce surprising results)

  • in bit arithmetics: & | ^ ~ <<>> (NOTE: these used to be forced to be 32 bits wide but now operate on the full native width.)

  • vec()

Note that unless you have the case (a) you will have to configureand compile Perl using the -Duse64bitint Configure flag.

  1. NOTE: The Configure flags -Duselonglong and -Duse64bits have been
  2. deprecated. Use -Duse64bitint instead.

There are actually two modes of 64-bitness: the first one is achievedusing Configure -Duse64bitint and the second one using Configure-Duse64bitall. The difference is that the first one is minimal andthe second one maximal. The first works in more places than the second.

The use64bitint does only as much as is required to get 64-bitintegers into Perl (this may mean, for example, using "long longs")while your memory may still be limited to 2 gigabytes (because yourpointers could still be 32-bit). Note that the name 64bitint doesnot imply that your C compiler will be using 64-bit ints (it might,but it doesn't have to): the use64bitint means that you will beable to have 64 bits wide scalar values.

The use64bitall goes all the way by attempting to switch alsointegers (if it can), longs (and pointers) to being 64-bit. This maycreate an even more binary incompatible Perl than -Duse64bitint: theresulting executable may not run at all in a 32-bit box, or you mayhave to reboot/reconfigure/rebuild your operating system to be 64-bitaware.

Natively 64-bit systems like Alpha and Cray need neither -Duse64bitintnor -Duse64bitall.

Last but not least: note that due to Perl's habit of always usingfloating point numbers, the quads are still not true integers.When quads overflow their limits (0...18_446_744_073_709_551_615 unsigned,-9_223_372_036_854_775_808...9_223_372_036_854_775_807 signed), theyare silently promoted to floating point numbers, after which they willstart losing precision (in their lower digits).

  1. NOTE: 64-bit support is still experimental on most platforms.
  2. Existing support only covers the LP64 data model. In particular, the
  3. LLP64 data model is not yet supported. 64-bit libraries and system
  4. APIs on many platforms have not stabilized--your mileage may vary.

Large file support

If you have filesystems that support "large files" (files larger than2 gigabytes), you may now also be able to create and access them fromPerl.

  1. NOTE: The default action is to enable large file support, if
  2. available on the platform.

If the large file support is on, and you have a Fcntl constantO_LARGEFILE, the O_LARGEFILE is automatically added to the flagsof sysopen().

Beware that unless your filesystem also supports "sparse files" seekingto umpteen petabytes may be inadvisable.

Note that in addition to requiring a proper file system to do largefiles you may also need to adjust your per-process (or yourper-system, or per-process-group, or per-user-group) maximum filesizelimits before running Perl scripts that try to handle large files,especially if you intend to write such files.

Finally, in addition to your process/process group maximum filesizelimits, you may have quota limits on your filesystems that stop you(your user id or your user group id) from using large files.

Adjusting your process/user/group/file system/operating system limitsis outside the scope of Perl core language. For process limits, youmay try increasing the limits using your shell's limits/limit/ulimitcommand before running Perl. The BSD::Resource extension (notincluded with the standard Perl distribution) may also be of use, itoffers the getrlimit/setrlimit interface that can be used to adjustprocess resource usage limits, including the maximum filesize limit.

Long doubles

In some systems you may be able to use long doubles to enhance therange and precision of your double precision floating point numbers(that is, Perl's numbers). Use Configure -Duselongdouble to enablethis support (if it is available).

"more bits"

You can "Configure -Dusemorebits" to turn on both the 64-bit supportand the long double support.

Enhanced support for sort() subroutines

Perl subroutines with a prototype of ($$), and XSUBs in general, cannow be used as sort subroutines. In either case, the two elements tobe compared are passed as normal parameters in @_. See sort.

For unprototyped sort subroutines, the historical behavior of passing the elements to be compared as the global variables $a and $b remainsunchanged.

sort $coderef @foo allowed

sort() did not accept a subroutine reference as the comparisonfunction in earlier versions. This is now permitted.

File globbing implemented internally

Perl now uses the File::Glob implementation of the glob() operatorautomatically. This avoids using an external csh process and theproblems associated with it.

  1. NOTE: This is currently an experimental feature. Interfaces and
  2. implementation are subject to change.

Support for CHECK blocks

In addition to BEGIN, INIT, END, DESTROY and AUTOLOAD,subroutines named CHECK are now special. These are queued up duringcompilation and behave similar to END blocks, except they are called atthe end of compilation rather than at the end of execution. They cannotbe called directly.

POSIX character class syntax [: :] supported

For example to match alphabetic characters use /[[:alpha:]]/.See perlre for details.

Better pseudo-random number generator

In 5.005_0x and earlier, perl's rand() function used the C libraryrand(3) function. As of 5.005_52, Configure tests for drand48(),random(), and rand() (in that order) and picks the first one it finds.

These changes should result in better random numbers from rand().

Improved qw// operator

The qw// operator is now evaluated at compile time into a true listinstead of being replaced with a run time call to split(). Thisremoves the confusing misbehaviour of qw// in scalar context, whichhad inherited that behaviour from split().

Thus:

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

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

Better worst-case behavior of hashes

Small changes in the hashing algorithm have been implemented inorder to improve the distribution of lower order bits in thehashed value. This is expected to yield better performance onkeys that are repeated sequences.

pack() format 'Z' supported

The new format type 'Z' is useful for packing and unpacking null-terminatedstrings. See pack.

pack() format modifier '!' supported

The new format type modifier '!' is useful for packing and unpackingnative shorts, ints, and longs. See pack.

pack() and unpack() support counted strings

The template character '/' can be used to specify a counted stringtype to be packed or unpacked. See pack.

Comments in pack() templates

The '#' character in a template introduces a comment up toend of the line. This facilitates documentation of pack()templates.

Weak references

In previous versions of Perl, you couldn't cache objects so asto allow them to be deleted if the last reference from outside the cache is deleted. The reference in the cache would hold areference count on the object and the objects would never bedestroyed.

Another familiar problem is with circular references. When anobject references itself, its reference count would never godown to zero, and it would not get destroyed until the programis about to exit.

Weak references solve this by allowing you to "weaken" anyreference, that is, make it not count towards the reference count.When the last non-weak reference to an object is deleted, the objectis destroyed and all the weak references to the object areautomatically undef-ed.

To use this feature, you need the Devel::WeakRef package from CPAN, whichcontains additional documentation.

  1. NOTE: This is an experimental feature. Details are subject to change.

Binary numbers supported

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

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

Lvalue subroutines

Subroutines can now return modifiable lvalues.See Lvalue subroutines in perlsub.

  1. NOTE: This is an experimental feature. Details are subject to change.

Some arrows may be omitted in calls through references

Perl now allows the arrow to be omitted in many constructsinvolving subroutine calls through references. For example,$foo[10]->('foo') may now be written $foo[10]('foo').This is rather similar to how the arrow may be omitted from$foo[10]->{'foo'}. Note however, that the arrow is stillrequired for foo(10)->('bar').

Boolean assignment operators are legal lvalues

Constructs such as ($a ||= 2) += 1 are now allowed.

exists() is supported on subroutine names

The exists() builtin now works on subroutine names. A subroutineis considered to exist if it has been declared (even if implicitly).See exists for examples.

exists() and delete() are supported on array elements

The exists() and delete() builtins now work on simple arrays as well.The behavior is similar to that on hash elements.

exists() can be used to check whether an array element has beeninitialized. This avoids autovivifying array elements that don't exist.If the array is tied, the EXISTS() method in the corresponding tiedpackage will be invoked.

delete() may be used to remove an element from the array and returnit. The array element at that position returns to its uninitializedstate, so that testing for the same element with exists() will returnfalse. If the element happens to be the one at the end, the size ofthe array also shrinks up to the highest element that tests true forexists(), or 0 if none such is found. If the array is tied, the DELETE() method in the corresponding tied package will be invoked.

See exists and delete for examples.

Pseudo-hashes work better

Dereferencing some types of reference values in a pseudo-hash,such as $ph->{foo}[1], was accidentally disallowed. This hasbeen corrected.

When applied to a pseudo-hash element, exists() now reports whetherthe specified value exists, not merely if the key is valid.

delete() now works on pseudo-hashes. When given a pseudo-hash elementor slice it deletes the values corresponding to the keys (but not the keysthemselves). See Pseudo-hashes: Using an array as a hash in perlref.

Pseudo-hash slices with constant keys are now optimized to array lookupsat compile-time.

List assignments to pseudo-hash slices are now supported.

The fields pragma now provides ways to create pseudo-hashes, viafields::new() and fields::phash(). See fields.

  1. NOTE: The pseudo-hash data type continues to be experimental.
  2. Limiting oneself to the interface elements provided by the
  3. fields pragma will provide protection from any future changes.

Automatic flushing of output buffers

fork(), exec(), system(), qx//, and pipe open()s now flush buffersof all files opened for output when the operation was attempted. Thismostly eliminates confusing buffering mishaps suffered by users unawareof how Perl internally handles I/O.

This is not supported on some platforms like Solaris where a suitablycorrect implementation of fflush(NULL) isn't available.

Better diagnostics on meaningless filehandle operations

Constructs such as open() and close()are compile time errors. Attempting to read from filehandles thatwere opened only for writing will now produce warnings (just aswriting to read-only filehandles does).

Where possible, buffered data discarded from duped input filehandle

open(NEW, "<&OLD") now attempts to discard any data thatwas previously read and buffered in OLD before duping the handle.On platforms where doing this is allowed, the next read operationon NEW will return the same data as the corresponding operationon OLD. Formerly, it would have returned the data from the startof the following disk block instead.

eof() has the same old magic as <>

eof() would return true if no attempt to read from <> hadyet been made. eof() has been changed to have a little magic of itsown, it now opens the <> files.

binmode() can be used to set :crlf and :raw modes

binmode() now accepts a second argument that specifies a disciplinefor the handle in question. The two pseudo-disciplines ":raw" and":crlf" are currently supported on DOS-derivative platforms.See binmode and open.

-T filetest recognizes UTF-8 encoded files as "text"

The algorithm used for the -T filetest has been enhanced tocorrectly identify UTF-8 content as "text".

system(), backticks and pipe open now reflect exec() failure

On Unix and similar platforms, system(), qx() and open(FOO, "cmd |")etc., are implemented via fork() and exec(). When the underlyingexec() fails, earlier versions did not report the error properly,since the exec() happened to be in a different process.

The child process now communicates with the parent about theerror in launching the external command, which allows theseconstructs to return with their usual error value and set $!.

Improved diagnostics

Line numbers are no longer suppressed (under most likely circumstances)during the global destruction phase.

Diagnostics emitted from code running in threads other than the mainthread are now accompanied by the thread ID.

Embedded null characters in diagnostics now actually show up. Theyused to truncate the message in prior versions.

$foo::a and $foo::b are now exempt from "possible typo" warnings onlyif sort() is encountered in package foo.

Unrecognized alphabetic escapes encountered when parsing quoteconstructs now generate a warning, since they may take on newsemantics in later versions of Perl.

Many diagnostics now report the internal operation in which the warningwas provoked, like so:

  1. Use of uninitialized value in concatenation (.) at (eval 1) line 1.
  2. Use of uninitialized value in print at (eval 1) line 1.

Diagnostics that occur within eval may also report the file and linenumber where the eval is located, in addition to the eval sequencenumber and the line number within the evaluated text itself. Forexample:

  1. Not enough arguments for scalar at (eval 4)[newlib/perl5db.pl:1411] line 2, at EOF

Diagnostics follow STDERR

Diagnostic output now goes to whichever file the STDERR handleis pointing at, instead of always going to the underlying C runtimelibrary's stderr.

More consistent close-on-exec behavior

On systems that support a close-on-exec flag on filehandles, theflag is now set for any handles created by pipe(), socketpair(),socket(), and accept(), if that is warranted by the value of $^Fthat may be in effect. Earlier versions neglected to set the flagfor handles created with these operators. See pipe,socketpair, socket, accept,and $^F in perlvar.

syswrite() ease-of-use

The length argument of syswrite() has become optional.

Better syntax checks on parenthesized unary operators

Expressions such as:

  1. print defined(&foo,&bar,&baz);
  2. print uc("foo","bar","baz");
  3. undef($foo,&bar);

used to be accidentally allowed in earlier versions, and producedunpredictable behaviour. Some produced ancillary warningswhen used in this way; others silently did the wrong thing.

The parenthesized forms of most unary operators that expect a singleargument now ensure that they are not called with more than oneargument, making the cases shown above syntax errors. The usualbehaviour of:

  1. print defined &foo, &bar, &baz;
  2. print uc "foo", "bar", "baz";
  3. undef $foo, &bar;

remains unchanged. See perlop.

Bit operators support full native integer width

The bit operators (& | ^ ~ <<>>) now operate on the full nativeintegral width (the exact size of which is available in $Config{ivsize}).For example, if your platform is either natively 64-bit or if Perlhas been configured to use 64-bit integers, these operations applyto 8 bytes (as opposed to 4 bytes on 32-bit platforms).For portability, be sure to mask off the excess bits in the result ofunary ~, e.g., ~$x & 0xffffffff.

Improved security features

More potentially unsafe operations taint their results for improvedsecurity.

The passwd and shell fields returned by the getpwent(), getpwnam(),and getpwuid() are now tainted, because the user can affect their ownencrypted password and login shell.

The variable modified by shmread(), and messages returned by msgrcv()(and its object-oriented interface IPC::SysV::Msg::rcv) are also tainted,because other untrusted processes can modify messages and shared memorysegments for their own nefarious purposes.

More functional bareword prototype (*)

Bareword prototypes have been rationalized to enable them to be usedto override builtins that accept barewords and interpret them ina special way, such as require or do.

Arguments prototyped as * will now be visible within the subroutineas either a simple scalar or as a reference to a typeglob.See Prototypes in perlsub.

require and do may be overridden

require and do 'file' operations may be overridden locallyby importing subroutines of the same name into the current package (or globally by importing them into the CORE::GLOBAL:: namespace).Overriding require will also affect use, provided the overrideis visible at compile-time.See Overriding Built-in Functions in perlsub.

$^X variables may now have names longer than one character

Formerly, $^X was synonymous with ${"\cX"}, but $^XY was a syntaxerror. Now variable names that begin with a control character may bearbitrarily long. However, for compatibility reasons, these variablesmust be written with explicit braces, as ${^XY} for example.${^XYZ} is synonymous with ${"\cXYZ"}. Variable names with morethan one control character, such as ${^XY^Z}, are illegal.

The old syntax has not changed. As before, `^X' may be either aliteral control-X character or the two-character sequence `caret' plus`X'. When braces are omitted, the variable name stops after thecontrol character. Thus "$^XYZ" continues to be synonymous with$^X . "YZ" as before.

As before, lexical variables may not have names beginning with controlcharacters. As before, variables whose names begin with a controlcharacter are always forced to be in package `main'. All such variablesare reserved for future extensions, except those that begin with^_, which may be used by user programs and are guaranteed not toacquire special meaning in any future version of Perl.

New variable $^C reflects -c switch

$^C has a boolean value that reflects whether perl is being runin compile-only mode (i.e. via the -c switch). SinceBEGIN blocks are executed under such conditions, this variableenables perl code to determine whether actions that make senseonly during normal running are warranted. See perlvar.

New variable $^V contains Perl version as a string

$^V contains the Perl version number as a string composed ofcharacters whose ordinals match the version numbers, i.e. v5.6.0.This may be used in string comparisons.

See Support for strings represented as a vector of ordinals for anexample.

Optional Y2K warnings

If Perl is built with the cpp macro PERL_Y2KWARN defined,it emits optional warnings when concatenating the number 19with another number.

This behavior must be specifically enabled when running Configure.See INSTALL and README.Y2K.

Arrays now always interpolate into double-quoted strings

In double-quoted strings, arrays now interpolate, no matter what. Thebehavior in earlier versions of perl 5 was that arrays would interpolateinto strings if the array had been mentioned before the string wascompiled, and otherwise Perl would raise a fatal compile-time error.In versions 5.000 through 5.003, the error was

  1. Literal @example now requires backslash

In versions 5.004_01 through 5.6.0, the error was

  1. In string, @example now must be written as \@example

The idea here was to get people into the habit of writing"fred\@example.com" when they wanted a literal @ sign, just asthey have always written "Give me back my \$5" when they wanted aliteral $ sign.

Starting with 5.6.1, when Perl now sees an @ sign in adouble-quoted string, it always attempts to interpolate an array,regardless of whether or not the array has been used or declaredalready. The fatal error has been downgraded to an optional warning:

  1. Possible unintended interpolation of @example in string

This warns you that "[email protected]" is going to turn intofred.com if you don't backslash the @.See http://perl.plover.com/at-error.html for more detailsabout the history here.

@- and @+ provide starting/ending offsets of regex submatches

The new magic variables @- and @+ provide the starting and endingoffsets, respectively, of $&, $1, $2, etc. See perlvar fordetails.

Modules and Pragmata

Modules

  • attributes

    While used internally by Perl as a pragma, this module alsoprovides a way to fetch subroutine and variable attributes.See attributes.

  • B

    The Perl Compiler suite has been extensively reworked for thisrelease. More of the standard Perl test suite passes when rununder the Compiler, but there is still a significant way togo to achieve production quality compiled executables.

    1. NOTE: The Compiler suite remains highly experimental. The
    2. generated code may not be correct, even when it manages to execute
    3. without errors.
  • Benchmark

    Overall, Benchmark results exhibit lower average error and better timingaccuracy.

    You can now run tests for n seconds instead of guessing the rightnumber of tests to run: e.g., timethese(-5, ...) will run each code for at least 5 CPU seconds. Zero as the "number of repetitions"means "for at least 3 CPU seconds". The output format has alsochanged. For example:

    1. use Benchmark;$x=3;timethese(-5,{a=>sub{$x*$x},b=>sub{$x**2}})

    will now output something like this:

    1. Benchmark: running a, b, each for at least 5 CPU seconds...
    2. a: 5 wallclock secs ( 5.77 usr + 0.00 sys = 5.77 CPU) @ 200551.91/s (n=1156516)
    3. b: 4 wallclock secs ( 5.00 usr + 0.02 sys = 5.02 CPU) @ 159605.18/s (n=800686)

    New features: "each for at least N CPU seconds...", "wallclock secs",and the "@ operations/CPU second (n=operations)".

    timethese() now returns a reference to a hash of Benchmark objects containingthe test results, keyed on the names of the tests.

    timethis() now returns the iterations field in the Benchmark result objectinstead of 0.

    timethese(), timethis(), and the new cmpthese() (see below) can also takea format specifier of 'none' to suppress output.

    A new function countit() is just like timeit() except that it takes aTIME instead of a COUNT.

    A new function cmpthese() prints a chart comparing the results of each testreturned from a timethese() call. For each possible pair of tests, thepercentage speed difference (iters/sec or seconds/iter) is shown.

    For other details, see Benchmark.

  • ByteLoader

    The ByteLoader is a dedicated extension to generate and runPerl bytecode. See ByteLoader.

  • constant

    References can now be used.

    The new version also allows a leading underscore in constant names, butdisallows a double leading underscore (as in "__LINE__"). Some other namesare disallowed or warned against, including BEGIN, END, etc. Some nameswhich were forced into main:: used to fail silently in some cases; now they'refatal (outside of main::) and an optional warning (inside of main::).The ability to detect whether a constant had been set with a given name hasbeen added.

    See constant.

  • charnames

    This pragma implements the \N string escape. See charnames.

  • Data::Dumper

    A Maxdepth setting can be specified to avoid venturingtoo deeply into deep data structures. See Data::Dumper.

    The XSUB implementation of Dump() is now automatically called if theUseqq setting is not in use.

    Dumping qr// objects works correctly.

  • DB

    DB is an experimental module that exposes a clean abstractionto Perl's debugging API.

  • DB_File

    DB_File can now be built with Berkeley DB versions 1, 2 or 3.See ext/DB_File/Changes.

  • Devel::DProf

    Devel::DProf, a Perl source code profiler has been added. SeeDevel::DProf and dprofpp.

  • Devel::Peek

    The Devel::Peek module provides access to the internal representationof Perl variables and data. It is a data debugging tool for the XS programmer.

  • Dumpvalue

    The Dumpvalue module provides screen dumps of Perl data.

  • DynaLoader

    DynaLoader now supports a dl_unload_file() function on platforms thatsupport unloading shared objects using dlclose().

    Perl can also optionally arrange to unload all extension shared objectsloaded by Perl. To enable this, build Perl with the Configure option-Accflags=-DDL_UNLOAD_ALL_AT_EXIT. (This maybe useful if you areusing Apache with mod_perl.)

  • English

    $PERL_VERSION now stands for $^V (a string value) rather than for $](a numeric value).

  • Env

    Env now supports accessing environment variables like PATH as arrayvariables.

  • Fcntl

    More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE forlarge file (more than 4GB) access (NOTE: the O_LARGEFILE isautomatically added to sysopen() flags if large file support has beenconfigured, as is the default), Free/Net/OpenBSD locking behaviourflags F_FLOCK, F_POSIX, Linux F_SHLCK, and O_ACCMODE: the combinedmask of O_RDONLY, O_WRONLY, and O_RDWR. The seek()/sysseek()constants SEEK_SET, SEEK_CUR, and SEEK_END are available via the:seek tag. The chmod()/stat() S_IF* constants and S_IS* functionsare available via the :mode tag.

  • File::Compare

    A compare_text() function has been added, which allows customcomparison functions. See File::Compare.

  • File::Find

    File::Find now works correctly when the wanted() function is eitherautoloaded or is a symbolic reference.

    A bug that caused File::Find to lose track of the working directorywhen pruning top-level directories has been fixed.

    File::Find now also supports several other options to control itsbehavior. It can follow symbolic links if the follow option isspecified. Enabling the no_chdir option will make File::Find skipchanging the current directory when walking directories. The untaintflag can be useful when running with taint checks enabled.

    See File::Find.

  • File::Glob

    This extension implements BSD-style file globbing. By default,it will also be used for the internal implementation of the glob()operator. See File::Glob.

  • File::Spec

    New methods have been added to the File::Spec module: devnull() returnsthe name of the null device (/dev/null on Unix) and tmpdir() the name ofthe temp directory (normally /tmp on Unix). There are now also methodsto convert between absolute and relative filenames: abs2rel() andrel2abs(). For compatibility with operating systems that specify volumenames in file paths, the splitpath(), splitdir(), and catdir() methodshave been added.

  • File::Spec::Functions

    The new File::Spec::Functions modules provides a function interfaceto the File::Spec module. Allows shorthand

    1. $fullname = catfile($dir1, $dir2, $file);

    instead of

    1. $fullname = File::Spec->catfile($dir1, $dir2, $file);
  • Getopt::Long

    Getopt::Long licensing has changed to allow the Perl Artistic Licenseas well as the GPL. It used to be GPL only, which got in the way ofnon-GPL applications that wanted to use Getopt::Long.

    Getopt::Long encourages the use of Pod::Usage to produce helpmessages. For example:

    1. use Getopt::Long;
    2. use Pod::Usage;
    3. my $man = 0;
    4. my $help = 0;
    5. GetOptions('help|?' => \$help, man => \$man) or pod2usage(2);
    6. pod2usage(1) if $help;
    7. pod2usage(-exitstatus => 0, -verbose => 2) if $man;
    8. __END__
    9. =head1 NAME
    10. sample - Using Getopt::Long and Pod::Usage
    11. =head1 SYNOPSIS
    12. sample [options] [file ...]
    13. Options:
    14. -help brief help message
    15. -man full documentation
    16. =head1 OPTIONS
    17. =over 8
    18. =item B<-help>
    19. Print a brief help message and exits.
    20. =item B<-man>
    21. Prints the manual page and exits.
    22. =back
    23. =head1 DESCRIPTION
    24. B<This program> will read the given input file(s) and do something
    25. useful with the contents thereof.
    26. =cut

    See Pod::Usage for details.

    A bug that prevented the non-option call-back <> from beingspecified as the first argument has been fixed.

    To specify the characters < and > as option starters, use ><. Note,however, that changing option starters is strongly deprecated.

  • IO

    write() and syswrite() will now accept a single-argumentform of the call, for consistency with Perl's syswrite().

    You can now create a TCP-based IO::Socket::INET without forcinga connect attempt. This allows you to configure its options(like making it non-blocking) and then call connect() manually.

    A bug that prevented the IO::Socket::protocol() accessorfrom ever returning the correct value has been corrected.

    IO::Socket::connect now uses non-blocking IO instead of alarm()to do connect timeouts.

    IO::Socket::accept now uses select() instead of alarm() for doingtimeouts.

    IO::Socket::INET->new now sets $! correctly on failure. $@ isstill set for backwards compatibility.

  • JPL

    Java Perl Lingo is now distributed with Perl. See jpl/READMEfor more information.

  • lib

    use lib now weeds out any trailing duplicate entries.no lib removes all named entries.

  • Math::BigInt

    The bitwise operations <<, >>, &, |,and ~ are now supported on bigints.

  • Math::Complex

    The accessor methods Re, Im, arg, abs, rho, and theta can now alsoact as mutators (accessor $z->Re(), mutator $z->Re(3)).

    The class method display_format and the corresponding object methoddisplay_format, in addition to accepting just one argument, now canalso accept a parameter hash. Recognized keys of a parameter hash are"style", which corresponds to the old one parameter case, and twonew parameters: "format", which is a printf()-style format string(defaults usually to "%.15g", you can revert to the default bysetting the format string to undef) used for both parts of acomplex number, and "polar_pretty_print" (defaults to true),which controls whether an attempt is made to try to recognize smallmultiples and rationals of pi (2pi, pi/2) at the argument (angle) of apolar complex number.

    The potentially disruptive change is that in list context both methodsnow return the parameter hash, instead of only the value of the"style" parameter.

  • Math::Trig

    A little bit of radial trigonometry (cylindrical and spherical),radial coordinate conversions, and the great circle distance were added.

  • Pod::Parser, Pod::InputObjects

    Pod::Parser is a base class for parsing and selecting sections ofpod documentation from an input stream. This module takes care ofidentifying pod paragraphs and commands in the input and hands off theparsed paragraphs and commands to user-defined methods which are freeto interpret or translate them as they see fit.

    Pod::InputObjects defines some input objects needed by Pod::Parser, andfor advanced users of Pod::Parser that need more about a command besidesits name and text.

    As of release 5.6.0 of Perl, Pod::Parser is now the officially sanctioned"base parser code" recommended for use by all pod2xxx translators.Pod::Text (pod2text) and Pod::Man (pod2man) have already been convertedto use Pod::Parser and efforts to convert Pod::HTML (pod2html) are alreadyunderway. For any questions or comments about pod parsing and translatingissues and utilities, please use the [email protected] mailing list.

    For further information, please see Pod::Parser and Pod::InputObjects.

  • Pod::Checker, podchecker

    This utility checks pod files for correct syntax, according toperlpod. Obvious errors are flagged as such, while warnings areprinted for mistakes that can be handled gracefully. The checklist isnot complete yet. See Pod::Checker.

  • Pod::ParseUtils, Pod::Find

    These modules provide a set of gizmos that are useful mainly for podtranslators. Pod::Find traverses directory structures andreturns found pod files, along with their canonical names (likeFile::Spec::Unix). Pod::ParseUtils containsPod::List (useful for storing pod list information), Pod::Hyperlink(for parsing the contents of L<> sequences) and Pod::Cache(for caching information about pod files, e.g., link nodes).

  • Pod::Select, podselect

    Pod::Select is a subclass of Pod::Parser which provides a functionnamed "podselect()" to filter out user-specified sections of raw poddocumentation from an input stream. podselect is a script that providesaccess to Pod::Select from other scripts to be used as a filter.See Pod::Select.

  • Pod::Usage, pod2usage

    Pod::Usage provides the function "pod2usage()" to print usage messages fora Perl script based on its embedded pod documentation. The pod2usage()function is generally useful to all script authors since it lets themwrite and maintain a single source (the pods) for documentation, thusremoving the need to create and maintain redundant usage message textconsisting of information already in the pods.

    There is also a pod2usage script which can be used from other kinds ofscripts to print usage messages from pods (even for non-Perl scriptswith pods embedded in comments).

    For details and examples, please see Pod::Usage.

  • Pod::Text and Pod::Man

    Pod::Text has been rewritten to use Pod::Parser. While pod2text() isstill available for backwards compatibility, the module now has a newpreferred interface. See Pod::Text for the details. The new Pod::Textmodule is easily subclassed for tweaks to the output, and two suchsubclasses (Pod::Text::Termcap for man-page-style bold and underliningusing termcap information, and Pod::Text::Color for markup with ANSI colorsequences) are now standard.

    pod2man has been turned into a module, Pod::Man, which also usesPod::Parser. In the process, several outstanding bugs related to quotesin section headers, quoting of code escapes, and nested lists have beenfixed. pod2man is now a wrapper script around this module.

  • SDBM_File

    An EXISTS method has been added to this module (and sdbm_exists() hasbeen added to the underlying sdbm library), so one can now call existson an SDBM_File tied hash and get the correct result, rather than aruntime error.

    A bug that may have caused data loss when more than one disk blockhappens to be read from the database in a single FETCH() has beenfixed.

  • Sys::Syslog

    Sys::Syslog now uses XSUBs to access facilities from syslog.h so itno longer requires syslog.ph to exist.

  • Sys::Hostname

    Sys::Hostname now uses XSUBs to call the C library's gethostname() oruname() if they exist.

  • Term::ANSIColor

    Term::ANSIColor is a very simple module to provide easy and readableaccess to the ANSI color and highlighting escape sequences, supported bymost ANSI terminal emulators. It is now included standard.

  • Time::Local

    The timelocal() and timegm() functions used to silently return bogusresults when the date fell outside the machine's integer range. Theynow consistently croak() if the date falls in an unsupported range.

  • Win32

    The error return value in list context has been changed for all functionsthat return a list of values. Previously these functions returned a listwith a single element undef if an error occurred. Now these functionsreturn the empty list in these situations. This applies to the followingfunctions:

    1. Win32::FsType
    2. Win32::GetOSVersion

    The remaining functions are unchanged and continue to return undef onerror even in list context.

    The Win32::SetLastError(ERROR) function has been added as a complementto the Win32::GetLastError() function.

    The new Win32::GetFullPathName(FILENAME) returns the full absolutepathname for FILENAME in scalar context. In list context it returnsa two-element list containing the fully qualified directory name andthe filename. See Win32.

  • XSLoader

    The XSLoader extension is a simpler alternative to DynaLoader.See XSLoader.

  • DBM Filters

    A new feature called "DBM Filters" has been added to all theDBM modules--DB_File, GDBM_File, NDBM_File, ODBM_File, and SDBM_File.DBM Filters add four new methods to each DBM module:

    1. filter_store_key
    2. filter_store_value
    3. filter_fetch_key
    4. filter_fetch_value

    These can be used to filter key-value pairs before the pairs arewritten to the database or just after they are read from the database.See perldbmfilter for further information.

Pragmata

use attrs is now obsolete, and is only provided forbackward-compatibility. It's been replaced by the sub : attributessyntax. See Subroutine Attributes in perlsub and attributes.

Lexical warnings pragma, use warnings;, to control optional warnings.See perllexwarn.

use filetest to control the behaviour of filetests (-r -w...). Currently only one subpragma implemented, "use filetest'access';", that uses access(2) or equivalent to check permissionsinstead of using stat(2) as usual. This matters in filesystemswhere there are ACLs (access control lists): the stat(2) might lie,but access(2) knows better.

The open pragma can be used to specify default disciplines forhandle constructors (e.g. open()) and for qx//. The twopseudo-disciplines :raw and :crlf are currently supported onDOS-derivative platforms (i.e. where binmode is not a no-op).See also binmode() can be used to set :crlf and :raw modes.

Utility Changes

dprofpp

dprofpp is used to display profile data generated using Devel::DProf.See dprofpp.

find2perl

The find2perl utility now uses the enhanced features of the File::Findmodule. The -depth and -follow options are supported. Pod documentationis also included in the script.

h2xs

The h2xs tool can now work in conjunction with C::Scan (availablefrom CPAN) to automatically parse real-life header files. The -M,-a, -k, and -o options are new.

perlcc

perlcc now supports the C and Bytecode backends. By default,it generates output from the simple C backend rather than theoptimized C backend.

Support for non-Unix platforms has been improved.

perldoc

perldoc has been reworked to avoid possible security holes.It will not by default let itself be run as the superuser, but youmay still use the -U switch to try to make it drop privilegesfirst.

The Perl Debugger

Many bug fixes and enhancements were added to perl5db.pl, thePerl debugger. The help documentation was rearranged. New commandsinclude < ?, > ?, and { ? to list out currentactions, man docpage to run your doc viewer on some perldocset, and support for quoted options. The help information wasrearranged, and should be viewable once again if you're using lessas your pager. A serious security hole was plugged--you shouldimmediately remove all older versions of the Perl debugger asinstalled in previous releases, all the way back to perl3, fromyour system to avoid being bitten by this.

Improved Documentation

Many of the platform-specific README files are now part of the perlinstallation. See perl for the complete list.

  • perlapi.pod

    The official list of public Perl API functions.

  • perlboot.pod

    A tutorial for beginners on object-oriented Perl.

  • perlcompile.pod

    An introduction to using the Perl Compiler suite.

  • perldbmfilter.pod

    A howto document on using the DBM filter facility.

  • perldebug.pod

    All material unrelated to running the Perl debugger, plus alllow-level guts-like details that risked crushing the casual userof the debugger, have been relocated from the old manpage to thenext entry below.

  • perldebguts.pod

    This new manpage contains excessively low-level material not relatedto the Perl debugger, but slightly related to debugging Perl itself.It also contains some arcane internal details of how the debuggingprocess works that may only be of interest to developers of Perldebuggers.

  • perlfork.pod

    Notes on the fork() emulation currently available for the Windows platform.

  • perlfilter.pod

    An introduction to writing Perl source filters.

  • perlhack.pod

    Some guidelines for hacking the Perl source code.

  • perlintern.pod

    A list of internal functions in the Perl source code.(List is currently empty.)

  • perllexwarn.pod

    Introduction and reference information about lexically scopedwarning categories.

  • perlnumber.pod

    Detailed information about numbers as they are represented in Perl.

  • perlopentut.pod

    A tutorial on using open() effectively.

  • perlreftut.pod

    A tutorial that introduces the essentials of references.

  • perltootc.pod

    A tutorial on managing class data for object modules.

  • perltodo.pod

    Discussion of the most often wanted features that may someday besupported in Perl.

  • perlunicode.pod

    An introduction to Unicode support features in Perl.

Performance enhancements

Simple sort() using { $a <=> $b } and the like are optimized

Many common sort() operations using a simple inlined block are nowoptimized for faster performance.

Optimized assignments to lexical variables

Certain operations in the RHS of assignment statements have beenoptimized to directly set the lexical variable on the LHS,eliminating redundant copying overheads.

Faster subroutine calls

Minor changes in how subroutine calls are handled internallyprovide marginal improvements in performance.

delete(), each(), values() and hash iteration are faster

The hash values returned by delete(), each(), values() and hashes in alist context are the actual values in the hash, instead of copies.This results in significantly better performance, because it eliminatesneedless copying in most situations.

Installation and Configuration Improvements

-Dusethreads means something different

The -Dusethreads flag now enables the experimental interpreter-based threadsupport by default. To get the flavor of experimental threads that was in5.005 instead, you need to run Configure with "-Dusethreads -Duse5005threads".

As of v5.6.0, interpreter-threads support is still lacking a way tocreate new threads from Perl (i.e., use Thread; will not work withinterpreter threads). use Thread; continues to be available when youspecify the -Duse5005threads option to Configure, bugs and all.

  1. NOTE: Support for threads continues to be an experimental feature.
  2. Interfaces and implementation are subject to sudden and drastic changes.

New Configure flags

The following new flags may be enabled on the Configure command lineby running Configure with -Dflag.

  1. usemultiplicity
  2. usethreads useithreads(new interpreter threads: no Perl API yet)
  3. usethreads use5005threads(threads as they were in 5.005)
  4. use64bitint(equal to now deprecated 'use64bits')
  5. use64bitall
  6. uselongdouble
  7. usemorebits
  8. uselargefiles
  9. usesocks(only SOCKS v5 supported)

Threadedness and 64-bitness now more daring

The Configure options enabling the use of threads and the use of64-bitness are now more daring in the sense that they no more have anexplicit list of operating systems of known threads/64-bitcapabilities. In other words: if your operating system has thenecessary APIs and datatypes, you should be able just to go ahead anduse them, for threads by Configure -Dusethreads, and for 64 bitseither explicitly by Configure -Duse64bitint or implicitly if yoursystem has 64-bit wide datatypes. See also 64-bit support.

Long Doubles

Some platforms have "long doubles", floating point numbers of evenlarger range than ordinary "doubles". To enable using long doubles forPerl's scalars, use -Duselongdouble.

-Dusemorebits

You can enable both -Duse64bitint and -Duselongdouble with -Dusemorebits.See also 64-bit support.

-Duselargefiles

Some platforms support system APIs that are capable of handling large files(typically, files larger than two gigabytes). Perl will try to use theseAPIs if you ask for -Duselargefiles.

See Large file support for more information.

installusrbinperl

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

SOCKS support

You can use "Configure -Dusesocks" which causes Perl to probefor the SOCKS proxy protocol library (v5, not v4). For more informationon SOCKS, see:

  1. http://www.socks.nec.com/

-A flag

You can "post-edit" the Configure variables using the Configure -Aswitch. The editing happens immediately after the platform specifichints files have been processed but before the actual configurationprocess starts. Run Configure -h to find out the full -A syntax.

Enhanced Installation Directories

The installation structure has been enriched to improve the supportfor maintaining multiple versions of perl, to provide locations forvendor-supplied modules, scripts, and manpages, and to ease maintenanceof locally-added modules, scripts, and manpages. See the section onInstallation Directories in the INSTALL file for complete details.For most users building and installing from source, the defaults shouldbe fine.

If you previously used Configure -Dsitelib or -Dsitearch to setspecial values for library directories, you might wish to consider usingthe new -Dsiteprefix setting instead. Also, if you wish to re-use aconfig.sh file from an earlier version of perl, you should be sure tocheck that Configure makes sensible choices for the new directories.See INSTALL for complete details.

gcc automatically tried if 'cc' does not seem to be working

In many platforms the vendor-supplied 'cc' is too stripped-down tobuild Perl (basically, the 'cc' doesn't do ANSI C). If this seemsto be the case and the 'cc' does not seem to be the GNU C compiler'gcc', an automatic attempt is made to find and use 'gcc' instead.

Platform specific changes

Supported platforms

  • The Mach CThreads (NEXTSTEP, OPENSTEP) are now supported by the Threadextension.

  • GNU/Hurd is now supported.

  • Rhapsody/Darwin is now supported.

  • EPOC is now supported (on Psion 5).

  • The cygwin port (formerly cygwin32) has been greatly improved.

DOS

  • Perl now works with djgpp 2.02 (and 2.03 alpha).

  • Environment variable names are not converted to uppercase any more.

  • Incorrect exit codes from backticks have been fixed.

  • This port continues to use its own builtin globbing (not File::Glob).

OS390 (OpenEdition MVS)

Support for this EBCDIC platform has not been renewed in this release.There are difficulties in reconciling Perl's standardization on UTF-8as its internal representation for characters with the EBCDIC characterset, because the two are incompatible.

It is unclear whether future versions will renew support for thisplatform, but the possibility exists.

VMS

Numerous revisions and extensions to configuration, build, testing, andinstallation process to accommodate core changes and VMS-specific options.

Expand %ENV-handling code to allow runtime mapping to logical names,CLI symbols, and CRTL environ array.

Extension of subprocess invocation code to accept filespecs as command"verbs".

Add to Perl command line processing the ability to use default file types andto recognize Unix-style 2>&1.

Expansion of File::Spec::VMS routines, and integration into ExtUtils::MM_VMS.

Extension of ExtUtils::MM_VMS to handle complex extensions more flexibly.

Barewords at start of Unix-syntax paths may be treated as text rather thanonly as logical names.

Optional secure translation of several logical names used internally by Perl.

Miscellaneous bugfixing and porting of new core code to VMS.

Thanks are gladly extended to the many people who have contributed VMSpatches, testing, and ideas.

Win32

Perl can now emulate fork() internally, using multiple interpreters runningin different concurrent threads. This support must be enabled at buildtime. See perlfork for detailed information.

When given a pathname that consists only of a drivename, such as A:,opendir() and stat() now use the current working directory for the driverather than the drive root.

The builtin XSUB functions in the Win32:: namespace are documented. SeeWin32.

$^X now contains the full path name of the running executable.

A Win32::GetLongPathName() function is provided to complementWin32::GetFullPathName() and Win32::GetShortPathName(). See Win32.

POSIX::uname() is supported.

system(1,...) now returns true process IDs rather than processhandles. kill() accepts any real process id, rather than strictlyreturn values from system(1,...).

For better compatibility with Unix, kill(0, $pid) can now be used totest whether a process exists.

The Shell module is supported.

Better support for building Perl under command.com in Windows 95has been added.

Scripts are read in binary mode by default to allow ByteLoader (andthe filter mechanism in general) to work properly. For compatibility,the DATA filehandle will be set to text mode if a carriage return isdetected at the end of the line containing the __END__ or __DATA__token; if not, the DATA filehandle will be left open in binary mode.Earlier versions always opened the DATA filehandle in text mode.

The glob() operator is implemented via the File::Glob extension,which supports glob syntax of the C shell. This increases the flexibilityof the glob() operator, but there may be compatibility issues forprograms that relied on the older globbing syntax. If you want topreserve compatibility with the older syntax, you might want to runperl with -MFile::DosGlob. For details and compatibility information,see File::Glob.

Significant bug fixes

<HANDLE> on empty files

With $/ set to undef, "slurping" an empty file returns a string ofzero length (instead of undef, as it used to) the first time theHANDLE is read after $/ is set to undef. Further reads yieldundef.

This means that the following will append "foo" to an empty file (it usedto do nothing):

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

The behaviour of:

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

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

eval '...' improvements

Line numbers (as reflected by caller() and most diagnostics) withineval '...' were often incorrect where here documents were involved.This has been corrected.

Lexical lookups for variables appearing in eval '...' withinfunctions that were themselves called within an eval '...' weresearching the wrong place for lexicals. The lexical search nowcorrectly ends at the subroutine's block boundary.

The use of return within eval {...} caused $@ not to be resetcorrectly when no exception occurred within the eval. This hasbeen fixed.

Parsing of here documents used to be flawed when they appeared asthe replacement expression in eval 's/.../.../e'. This hasbeen fixed.

All compilation errors are true errors

Some "errors" encountered at compile time were by necessity generated as warnings followed by eventual termination of theprogram. This enabled more such errors to be reported in asingle run, rather than causing a hard stop at the first errorthat was encountered.

The mechanism for reporting such errors has been reimplementedto queue compile-time errors and report them at the end of thecompilation as true errors rather than as warnings. This fixescases where error messages leaked through in the form of warningswhen code was compiled at run time using eval STRING, andalso allows such errors to be reliably trapped using eval "...".

Implicitly closed filehandles are safer

Sometimes implicitly closed filehandles (as when they are localized,and Perl automatically closes them on exiting the scope) couldinadvertently set $? or $!. This has been corrected.

Behavior of list slices is more consistent

When taking a slice of a literal list (as opposed to a slice ofan array or hash), Perl used to return an empty list if theresult happened to be composed of all undef values.

The new behavior is to produce an empty list if (and only if)the original list was empty. Consider the following example:

  1. @a = (1,undef,undef,2)[2,1,2];

The old behavior would have resulted in @a having no elements.The new behavior ensures it has three undefined elements.

Note in particular that the behavior of slices of the followingcases remains unchanged:

  1. @a = ()[1,2];
  2. @a = (getpwent)[7,0];
  3. @a = (anything_returning_empty_list())[2,1,2];
  4. @a = @b[2,1,2];
  5. @a = @c{'a','b','c'};

See perldata.

(\$) prototype and $foo{a}

A scalar reference prototype now correctly allows a hash orarray element in that slot.

goto &sub and AUTOLOAD

The goto &sub construct works correctly when &sub happensto be autoloaded.

-bareword allowed under use integer

The autoquoting of barewords preceded by - did not workin prior versions when the integer pragma was enabled.This has been fixed.

Failures in DESTROY()

When code in a destructor threw an exception, it went unnoticedin earlier versions of Perl, unless someone happened to belooking in $@ just after the point the destructor happened torun. Such failures are now visible as warnings when warnings areenabled.

Locale bugs fixed

printf() and sprintf() previously reset the numeric localeback to the default "C" locale. This has been fixed.

Numbers formatted according to the local numeric locale(such as using a decimal comma instead of a decimal dot) caused"isn't numeric" warnings, even while the operations accessingthose numbers produced correct results. These warnings have beendiscontinued.

Memory leaks

The eval 'return sub {...}' construct could sometimes leakmemory. This has been fixed.

Operations that aren't filehandle constructors used to leak memorywhen used on invalid filehandles. This has been fixed.

Constructs that modified @_ could fail to deallocate valuesin @_ and thus leak memory. This has been corrected.

Spurious subroutine stubs after failed subroutine calls

Perl could sometimes create empty subroutine stubs when asubroutine was not found in the package. Such cases stoppedlater method lookups from progressing into base packages.This has been corrected.

Taint failures under -U

When running in unsafe mode, taint violations could sometimescause silent failures. This has been fixed.

END blocks and the -c switch

Prior versions used to run BEGIN and END blocks when Perl wasrun in compile-only mode. Since this is typically not the expectedbehavior, END blocks are not executed anymore when the -c switchis used, or if compilation fails.

See Support for CHECK blocks for how to run things when the compile phase ends.

Potential to leak DATA filehandles

Using the __DATA__ token creates an implicit filehandle tothe file that contains the token. It is the program'sresponsibility to close it when it is done reading from it.

This caveat is now better explained in the documentation.See perldata.

New or Changed Diagnostics

  • "%s" variable %s masks earlier declaration in same %s

    (W misc) A "my" or "our" variable has been redeclared in the current scope or statement,effectively eliminating all access to the previous instance. This is almostalways a typographical error. Note that the earlier variable will still existuntil the end of the scope or until all closure referents to it aredestroyed.

  • "my sub" not yet implemented

    (F) Lexically scoped subroutines are not yet implemented. Don't try thatyet.

  • "our" variable %s redeclared

    (W misc) You seem to have already declared the same global once before in thecurrent lexical scope.

  • '!' allowed only after types %s

    (F) The '!' is allowed in pack() and unpack() only after certain types.See pack.

  • / cannot take a count

    (F) You had an unpack template indicating a counted-length string,but you have also specified an explicit size for the string.See pack.

  • / must be followed by a, A or Z

    (F) You had an unpack template indicating a counted-length string,which must be followed by one of the letters a, A or Zto indicate what sort of string is to be unpacked.See pack.

  • / must be followed by a*, A* or Z*

    (F) You had a pack template indicating a counted-length string,Currently the only things that can have their length counted are a*, A* or Z*.See pack.

  • / must follow a numeric type

    (F) You had an unpack template that contained a '#',but this did not follow some numeric unpack specification.See pack.

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

    (W regexp) You used a backslash-character combination which is not recognizedby Perl. This combination appears in an interpolated variable or a'-delimited regular expression. The character was understood literally.

  • /%s/: Unrecognized escape \%c in character class passed through

    (W regexp) You used a backslash-character combination which is not recognizedby Perl inside character classes. The character was understood literally.

  • /%s/ should probably be written as "%s"

    (W syntax) You have used a pattern where Perl expected to find a string,as in the first argument to join. Perl will treat the trueor false result of matching the pattern against $_ as the string,which is probably not what you had in mind.

  • %s() called too early to check prototype

    (W prototype) You've called a function that has a prototype before the parser saw adefinition or declaration for it, and Perl could not check that the callconforms to the prototype. You need to either add an early prototypedeclaration for the subroutine in question, or move the subroutinedefinition ahead of the call to get proper prototype checking. Alternatively,if you are certain that you're calling the function correctly, you may putan ampersand before the name to avoid the warning. See perlsub.

  • %s argument is not a HASH or ARRAY element

    (F) The argument to exists() must be a hash or array element, such as:

    1. $foo{$bar}
    2. $ref->{"susie"}[12]
  • %s argument is not a HASH or ARRAY element or slice

    (F) The argument to delete() must be either a hash or array element, such as:

    1. $foo{$bar}
    2. $ref->{"susie"}[12]

    or a hash or array slice, such as:

    1. @foo[$bar, $baz, $xyzzy]
    2. @{$ref->[12]}{"susie", "queue"}
  • %s argument is not a subroutine name

    (F) The argument to exists() for exists &sub must be a subroutinename, and not a subroutine call. exists &sub() will generate this error.

  • %s package attribute may clash with future reserved word: %s

    (W reserved) A lowercase attribute name was used that had a package-specific handler.That name might have a meaning to Perl itself some day, even though itdoesn't yet. Perhaps you should use a mixed-case attribute name, instead.See attributes.

  • (in cleanup) %s

    (W misc) This prefix usually indicates that a DESTROY() method raisedthe indicated exception. Since destructors are usually called bythe system at arbitrary points during execution, and often a vastnumber of times, the warning is issued only once for any numberof failures that would otherwise result in the same message beingrepeated.

    Failure of user callbacks dispatched using the G_KEEPERR flagcould also result in this warning. See G_KEEPERR in perlcall.

  • <> should be quotes

    (F) You wrote require <file> when you should have writtenrequire 'file'.

  • Attempt to join self

    (F) You tried to join a thread from within itself, which is animpossible task. You may be joining the wrong thread, or you mayneed to move the join() to some other thread.

  • Bad evalled substitution pattern

    (F) You've used the /e switch to evaluate the replacement for asubstitution, but perl found a syntax error in the code to evaluate,most likely an unexpected right brace '}'.

  • Bad realloc() ignored

    (S) An internal routine called realloc() on something that had never beenmalloc()ed in the first place. Mandatory, but can be disabled bysetting environment variable PERL_BADFREE to 1.

  • Bareword found in conditional

    (W bareword) The compiler found a bareword where it expected a conditional,which often indicates that an || or && was parsed as part of thelast argument of the previous construct, for example:

    1. open FOO || die;

    It may also indicate a misspelled constant that has been interpretedas a bareword:

    1. use constant TYPO => 1;
    2. if (TYOP) { print "foo" }

    The strict pragma is useful in avoiding such errors.

  • Binary number > 0b11111111111111111111111111111111 non-portable

    (W portable) The binary number you specified is larger than 2**32-1(4294967295) and therefore non-portable between systems. Seeperlport for more on portability concerns.

  • Bit vector size > 32 non-portable

    (W portable) Using bit vector sizes larger than 32 is non-portable.

  • Buffer overflow in prime_env_iter: %s

    (W internal) A warning peculiar to VMS. While Perl was preparing to iterate over%ENV, it encountered a logical name or symbol definition which was too long,so it was truncated to the string shown.

  • Can't check filesystem of script "%s"

    (P) For some reason you can't check the filesystem of the script for nosuid.

  • Can't declare class for non-scalar %s in "%s"

    (S) Currently, only scalar variables can declared with a specific classqualifier in a "my" or "our" declaration. The semantics may be extendedfor other types of variables in future.

  • Can't declare %s in "%s"

    (F) Only scalar, array, and hash variables may be declared as "my" or"our" variables. They must have ordinary identifiers as names.

  • Can't ignore signal CHLD, forcing to default

    (W signal) Perl has detected that it is being run with the SIGCHLD signal(sometimes known as SIGCLD) disabled. Since disabling this signalwill interfere with proper determination of exit status of childprocesses, Perl has reset the signal to its default value.This situation typically indicates that the parent program underwhich Perl may be running (e.g., cron) is being very careless.

  • Can't modify non-lvalue subroutine call

    (F) Subroutines meant to be used in lvalue context should be declared assuch, see Lvalue subroutines in perlsub.

  • Can't read CRTL environ

    (S) A warning peculiar to VMS. Perl tried to read an element of %ENVfrom the CRTL's internal environment array and discovered the array wasmissing. You need to figure out where your CRTL misplaced its environor define PERL_ENV_TABLES (see perlvms) so that environ is not searched.

  • Can't remove %s: %s, skipping file

    (S) You requested an inplace edit without creating a backup file. Perlwas unable to remove the original file to replace it with the modifiedfile. The file was left unmodified.

  • Can't return %s from lvalue subroutine

    (F) Perl detected an attempt to return illegal lvalues (suchas temporary or readonly values) from a subroutine used as an lvalue.This is not allowed.

  • Can't weaken a nonreference

    (F) You attempted to weaken something that was not a reference. Onlyreferences can be weakened.

  • Character class [:%s:] unknown

    (F) The class in the character class [: :] syntax is unknown.See perlre.

  • Character class syntax [%s] belongs inside character classes

    (W unsafe) The character class constructs [: :], [= =], and [. .] goinside character classes, the [] are part of the construct,for example: /[012[:alpha:]345]/. Note that [= =] and [. .]are not currently implemented; they are simply placeholders forfuture extensions.

  • Constant is not %s reference

    (F) A constant value (perhaps declared using the use constant pragma)is being dereferenced, but it amounts to the wrong type of reference. Themessage indicates the type of reference that was expected. This usuallyindicates a syntax error in dereferencing the constant value.See Constant Functions in perlsub and constant.

  • constant(%s): %s

    (F) The parser found inconsistencies either while attempting to define anoverloaded constant, or when trying to find the character name specifiedin the \N{...} escape. Perhaps you forgot to load the correspondingoverload or charnames pragma? See charnames and overload.

  • CORE::%s is not a keyword

    (F) The CORE:: namespace is reserved for Perl keywords.

  • defined(@array) is deprecated

    (D) defined() is not usually useful on arrays because it checks for anundefined scalar value. If you want to see if the array is empty,just use if (@array) { # not empty } for example.

  • defined(%hash) is deprecated

    (D) defined() is not usually useful on hashes because it checks for anundefined scalar value. If you want to see if the hash is empty,just use if (%hash) { # not empty } for example.

  • Did not produce a valid header

    See Server error.

  • (Did you mean "local" instead of "our"?)

    (W misc) Remember that "our" does not localize the declared global variable.You have declared it again in the same lexical scope, which seems superfluous.

  • Document contains no data

    See Server error.

  • entering effective %s failed

    (F) While under the use filetest pragma, switching the real andeffective uids or gids failed.

  • false [] range "%s" in regexp

    (W regexp) A character class range must start and end at a literal character, notanother character class like \d or [:alpha:]. The "-" in your falserange is interpreted as a literal "-". Consider quoting the "-", "\-".See perlre.

  • Filehandle %s opened only for output

    (W io) You tried to read from a filehandle opened only for writing. If youintended it to be a read/write filehandle, you needed to open it with"+<" or "+>" or "+>>" instead of with "<" or nothing. Ifyou intended only to read from the file, use "<". Seeopen.

  • flock() on closed filehandle %s

    (W closed) The filehandle you're attempting to flock() got itself closed sometime before now. Check your logic flow. flock() operates on filehandles.Are you attempting to call flock() on a dirhandle by the same name?

  • Global symbol "%s" requires explicit package name

    (F) You've said "use strict vars", which indicates that all variablesmust either be lexically scoped (using "my"), declared beforehand using"our", or explicitly qualified to say which package the global variableis in (using "::").

  • Hexadecimal number > 0xffffffff non-portable

    (W portable) The hexadecimal number you specified is larger than 2**32-1(4294967295) and therefore non-portable between systems. Seeperlport for more on portability concerns.

  • Ill-formed CRTL environ value "%s"

    (W internal) A warning peculiar to VMS. Perl tried to read the CRTL's internalenviron array, and encountered an element without the = delimiterused to separate keys from values. The element is ignored.

  • Ill-formed message in prime_env_iter: |%s|

    (W internal) A warning peculiar to VMS. Perl tried to read a logical nameor CLI symbol definition when preparing to iterate over %ENV, anddidn't see the expected delimiter between key and value, so theline was ignored.

  • Illegal binary digit %s

    (F) You used a digit other than 0 or 1 in a binary number.

  • Illegal binary digit %s ignored

    (W digit) You may have tried to use a digit other than 0 or 1 in a binary number.Interpretation of the binary number stopped before the offending digit.

  • Illegal number of bits in vec

    (F) The number of bits in vec() (the third argument) must be a power oftwo from 1 to 32 (or 64, if your platform supports that).

  • Integer overflow in %s number

    (W overflow) The hexadecimal, octal or binary number you have specified eitheras a literal or as an argument to hex() or oct() is too big for yourarchitecture, and has been converted to a floating point number. On a32-bit architecture the largest hexadecimal, octal or binary numberrepresentable without overflow is 0xFFFFFFFF, 037777777777, or0b11111111111111111111111111111111 respectively. Note that Perltransparently promotes all numbers to a floating point representationinternally--subject to loss of precision errors in subsequentoperations.

  • Invalid %s attribute: %s

    The indicated attribute for a subroutine or variable was not recognizedby Perl or by a user-supplied handler. See attributes.

  • Invalid %s attributes: %s

    The indicated attributes for a subroutine or variable were not recognizedby Perl or by a user-supplied handler. See attributes.

  • invalid [] range "%s" in regexp

    The offending range is now explicitly displayed.

  • Invalid separator character %s in attribute list

    (F) Something other than a colon or whitespace was seen between theelements of an attribute list. If the previous attributehad a parenthesised parameter list, perhaps that list was terminatedtoo soon. See attributes.

  • Invalid separator character %s in subroutine attribute list

    (F) Something other than a colon or whitespace was seen between theelements of a subroutine attribute list. If the previous attributehad a parenthesised parameter list, perhaps that list was terminatedtoo soon.

  • leaving effective %s failed

    (F) While under the use filetest pragma, switching the real andeffective uids or gids failed.

  • Lvalue subs returning %s not implemented yet

    (F) Due to limitations in the current implementation, array and hashvalues cannot be returned in subroutines used in lvalue context.See Lvalue subroutines in perlsub.

  • Method %s not permitted

    See Server error.

  • Missing %sbrace%s on \N{}

    (F) Wrong syntax of character name literal \N{charname} withindouble-quotish context.

  • Missing command in piped open

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

  • Missing name in "my sub"

    (F) The reserved syntax for lexically scoped subroutines requires that theyhave a name with which they can be found.

  • No %s specified for -%c

    (F) The indicated command line switch needs a mandatory argument, butyou haven't specified one.

  • No package name allowed for variable %s in "our"

    (F) Fully qualified variable names are not allowed in "our" declarations,because that doesn't make much sense under existing semantics. Suchsyntax is reserved for future extensions.

  • No space allowed after -%c

    (F) The argument to the indicated command line switch must follow immediatelyafter the switch, without intervening spaces.

  • no UTC offset information; assuming local time is UTC

    (S) A warning peculiar to VMS. Perl was unable to find the localtimezone offset, so it's assuming that local system time is equivalentto UTC. If it's not, define the logical name SYS$TIMEZONE_DIFFERENTIALto translate to the number of seconds which need to be added to UTC toget local time.

  • Octal number > 037777777777 non-portable

    (W portable) The octal number you specified is larger than 2**32-1 (4294967295)and therefore non-portable between systems. See perlport for moreon portability concerns.

    See also perlport for writing portable code.

  • panic: del_backref

    (P) Failed an internal consistency check while trying to reset a weakreference.

  • panic: kid popen errno read

    (F) forked child returned an incomprehensible message about its errno.

  • panic: magic_killbackrefs

    (P) Failed an internal consistency check while trying to reset all weakreferences to an object.

  • Parentheses missing around "%s" list

    (W parenthesis) You said something like

    1. my $foo, $bar = @_;

    when you meant

    1. my ($foo, $bar) = @_;

    Remember that "my", "our", and "local" bind tighter than comma.

  • Possible unintended interpolation of %s in string

    (W ambiguous) It used to be that Perl would try to guess whether youwanted an array interpolated or a literal @. It no longer does this;arrays are now always interpolated into strings. This means that if you try something like:

    1. print "[email protected]";

    and the array @example doesn't exist, Perl is going to printfred.com, which is probably not what you wanted. To get a literal@ sign in a string, put a backslash before it, just as you wouldto get a literal $ sign.

  • Possible Y2K bug: %s

    (W y2k) You are concatenating the number 19 with another number, whichcould be a potential Year 2000 problem.

  • pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead

    (W deprecated) You have written something like this:

    1. sub doit
    2. {
    3. use attrs qw(locked);
    4. }

    You should use the new declaration syntax instead.

    1. sub doit : locked
    2. {
    3. ...

    The use attrs pragma is now obsolete, and is only provided forbackward-compatibility. See Subroutine Attributes in perlsub.

  • Premature end of script headers

    See Server error.

  • Repeat count in pack overflows

    (F) You can't specify a repeat count so large that it overflowsyour signed integers. See pack.

  • Repeat count in unpack overflows

    (F) You can't specify a repeat count so large that it overflowsyour signed integers. See unpack.

  • realloc() of freed memory ignored

    (S) An internal routine called realloc() on something that had alreadybeen freed.

  • Reference is already weak

    (W misc) You have attempted to weaken a reference that is already weak.Doing so has no effect.

  • setpgrp can't take arguments

    (F) Your system has the setpgrp() from BSD 4.2, which takes no arguments,unlike POSIX setpgid(), which takes a process ID and process group ID.

  • Strange *+?{} on zero-length expression

    (W regexp) You applied a regular expression quantifier in a place where itmakes no sense, such as on a zero-width assertion.Try putting the quantifier inside the assertion instead. For example,the way to match "abc" provided that it is followed by threerepetitions of "xyz" is /abc(?=(?:xyz){3})/, not /abc(?=xyz){3}/.

  • switching effective %s is not implemented

    (F) While under the use filetest pragma, we cannot switch thereal and effective uids or gids.

  • This Perl can't reset CRTL environ elements (%s)
  • This Perl can't set CRTL environ elements (%s=%s)

    (W internal) Warnings peculiar to VMS. You tried to change or delete an elementof the CRTL's internal environ array, but your copy of Perl wasn'tbuilt with a CRTL that contained the setenv() function. You'll need torebuild Perl with a CRTL that does, or redefine PERL_ENV_TABLES (seeperlvms) so that the environ array isn't the target of the change to%ENV which produced the warning.

  • Too late to run %s block

    (W void) A CHECK or INIT block is being defined during run time proper,when the opportunity to run them has already passed. Perhaps you areloading a file with require or do when you should be usinguse instead. Or perhaps you should put the require or doinside a BEGIN block.

  • Unknown open() mode '%s'

    (F) The second argument of 3-argument open() is not among the listof valid modes: <, >, >>, +<,+>, +>>, -|, |-.

  • Unknown process %x sent message to prime_env_iter: %s

    (P) An error peculiar to VMS. Perl was reading values for %ENV beforeiterating over it, and someone else stuck a message in the stream ofdata Perl expected. Someone's very confused, or perhaps trying tosubvert Perl's population of %ENV for nefarious purposes.

  • Unrecognized escape \%c passed through

    (W misc) You used a backslash-character combination which is not recognizedby Perl. The character was understood literally.

  • Unterminated attribute parameter in attribute list

    (F) The lexer saw an opening (left) parenthesis character while parsing anattribute list, but the matching closing (right) parenthesischaracter was not found. You may need to add (or remove) a backslashcharacter to get your parentheses to balance. See attributes.

  • Unterminated attribute list

    (F) The lexer found something other than a simple identifier at the startof an attribute, and it wasn't a semicolon or the start of ablock. Perhaps you terminated the parameter list of the previous attributetoo soon. See attributes.

  • Unterminated attribute parameter in subroutine attribute list

    (F) The lexer saw an opening (left) parenthesis character while parsing asubroutine attribute list, but the matching closing (right) parenthesischaracter was not found. You may need to add (or remove) a backslashcharacter to get your parentheses to balance.

  • Unterminated subroutine attribute list

    (F) The lexer found something other than a simple identifier at the startof a subroutine attribute, and it wasn't a semicolon or the start of ablock. Perhaps you terminated the parameter list of the previous attributetoo soon.

  • Value of CLI symbol "%s" too long

    (W misc) A warning peculiar to VMS. Perl tried to read the value of an %ENVelement from a CLI symbol table, and found a resultant string longerthan 1024 characters. The return value has been truncated to 1024characters.

  • Version number must be a constant number

    (P) The attempt to translate a use Module n.n LIST statement intoits equivalent BEGIN block found an internal inconsistency withthe version number.

New tests

  • lib/attrs

    Compatibility tests for sub : attrs vs the older use attrs.

  • lib/env

    Tests for new environment scalar capability (e.g., use Env qw($BAR);).

  • lib/env-array

    Tests for new environment array capability (e.g., use Env qw(@PATH);).

  • lib/io_const

    IO constants (SEEK_*, _IO*).

  • lib/io_dir

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

  • lib/io_multihomed

    INET sockets with multi-homed hosts.

  • lib/io_poll

    IO poll().

  • lib/io_unix

    UNIX sockets.

  • op/attrs

    Regression tests for my ($x,@y,%z) : attrs and <sub : attrs>.

  • op/filetest

    File test operators.

  • op/lex_assign

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

  • op/exists_sub

    Verify exists &sub operations.

Incompatible Changes

Perl Source Incompatibilities

Beware that any new warnings that have been added or old onesthat have been enhanced are not considered incompatible changes.

Since all new warnings must be explicitly requested via the -wswitch or the warnings pragma, it is ultimately the programmer'sresponsibility to ensure that warnings are enabled judiciously.

  • CHECK is a new keyword

    All subroutine definitions named CHECK are now special. See/"Support for CHECK blocks" for more information.

  • Treatment of list slices of undef has changed

    There is a potential incompatibility in the behavior of list slicesthat are comprised entirely of undefined values.See Behavior of list slices is more consistent.

  • Format of $English::PERL_VERSION is different

    The English module now sets $PERL_VERSION to $^V (a string value) ratherthan $] (a numeric value). This is a potential incompatibility.Send us a report via perlbug if you are affected by this.

    See Improved Perl version numbering system for the reasons forthis change.

  • Literals of the form 1.2.3 parse differently

    Previously, numeric literals with more than one dot in them wereinterpreted as a floating point number concatenated with one or morenumbers. Such "numbers" are now parsed as strings composed of thespecified ordinals.

    For example, print 97.98.99 used to output 97.9899 in earlierversions, but now prints abc.

    See Support for strings represented as a vector of ordinals.

  • Possibly changed pseudo-random number generator

    Perl programs that depend on reproducing a specific set of pseudo-randomnumbers may now produce different output due to improvements made to therand() builtin. You can use sh Configure -Drandfunc=rand to obtainthe old behavior.

    See Better pseudo-random number generator.

  • Hashing function for hash keys has changed

    Even though Perl hashes are not order preserving, the apparentlyrandom order encountered when iterating on the contents of a hashis actually determined by the hashing algorithm used. Improvementsin the algorithm may yield a random order that is different fromthat of previous versions, especially when iterating on hashes.

    See Better worst-case behavior of hashes for additionalinformation.

  • undef fails on read only values

    Using the undef operator on a readonly value (such as $1) hasthe same effect as assigning undef to the readonly value--itthrows an exception.

  • Close-on-exec bit may be set on pipe and socket handles

    Pipe and socket handles are also now subject to the close-on-execbehavior determined by the special variable $^F.

    See More consistent close-on-exec behavior.

  • Writing "$$1" to mean "${$}1" is unsupported

    Perl 5.004 deprecated the interpretation of $$1 andsimilar within interpolated strings to mean $$ . "1",but still allowed it.

    In Perl 5.6.0 and later, "$$1" always means "${$1}".

  • delete(), each(), values() and \(%h)

    operate on aliases to values, not copies

    delete(), each(), values() and hashes (e.g. \(%h))in a list context return the actualvalues in the hash, instead of copies (as they used to in earlierversions). Typical idioms for using these constructs copy thereturned values, but this can make a significant difference whencreating references to the returned values. Keys in the hash are stillreturned as copies when iterating on a hash.

    See also delete(), each(), values() and hash iteration are faster.

  • vec(EXPR,OFFSET,BITS) enforces powers-of-two BITS

    vec() generates a run-time error if the BITS argument is nota valid power-of-two integer.

  • Text of some diagnostic output has changed

    Most references to internal Perl operations in diagnosticshave been changed to be more descriptive. This may be anissue for programs that may incorrectly rely on the exacttext of diagnostics for proper functioning.

  • %@ has been removed

    The undocumented special variable %@ that used to accumulate"background" errors (such as those that happen in DESTROY())has been removed, because it could potentially result in memoryleaks.

  • Parenthesized not() behaves like a list operator

    The not operator now falls under the "if it looks like a function,it behaves like a function" rule.

    As a result, the parenthesized form can be used with grep and map.The following construct used to be a syntax error before, but it worksas expected now:

    1. grep not($_), @things;

    On the other hand, using not with a literal list slice may notwork. The following previously allowed construct:

    1. print not (1,2,3)[0];

    needs to be written with additional parentheses now:

    1. print not((1,2,3)[0]);

    The behavior remains unaffected when not is not followed by parentheses.

  • Semantics of bareword prototype (*) have changed

    The semantics of the bareword prototype * have changed. Perl 5.005always coerced simple scalar arguments to a typeglob, which wasn't usefulin situations where the subroutine must distinguish between a simplescalar and a typeglob. The new behavior is to not coerce barewordarguments to a typeglob. The value will always be visible as eithera simple scalar or as a reference to a typeglob.

    See More functional bareword prototype (*).

  • Semantics of bit operators may have changed on 64-bit platforms

    If your platform is either natively 64-bit or if Perl has beenconfigured to used 64-bit integers, i.e., $Config{ivsize} is 8, there may be a potential incompatibility in the behavior of bitwisenumeric operators (& | ^ ~ <<>>). These operators used to strictlyoperate on the lower 32 bits of integers in previous versions, but nowoperate over the entire native integral width. In particular, notethat unary ~ will produce different results on platforms that havedifferent $Config{ivsize}. For portability, be sure to mask offthe excess bits in the result of unary ~, e.g., ~$x & 0xffffffff.

    See Bit operators support full native integer width.

  • More builtins taint their results

    As described in Improved security features, there may be moresources of taint in a Perl program.

    To avoid these new tainting behaviors, you can build Perl with theConfigure option -Accflags=-DINCOMPLETE_TAINTS. Beware that theensuing perl binary may be insecure.

C Source Incompatibilities

  • PERL_POLLUTE

    Release 5.005 grandfathered old global symbol names by providing preprocessormacros for extension source compatibility. As of release 5.6.0, thesepreprocessor definitions are not available by default. You need to explicitlycompile perl with -DPERL_POLLUTE to get these definitions. Forextensions still using the old symbols, this option can bespecified via MakeMaker:

    1. perl Makefile.PL POLLUTE=1
  • PERL_IMPLICIT_CONTEXT

    This new build option provides a set of macros for all API functionssuch that an implicit interpreter/thread context argument is passed toevery API function. As a result of this, something like sv_setsv(foo,bar)amounts to a macro invocation that actually translates to something likePerl_sv_setsv(my_perl,foo,bar). While this is generally expectedto not have any significant source compatibility issues, the differencebetween a macro and a real function call will need to be considered.

    This means that there is a source compatibility issue as a result ofthis if your extensions attempt to use pointers to any of the Perl APIfunctions.

    Note that the above issue is not relevant to the default build ofPerl, whose interfaces continue to match those of prior versions(but subject to the other options described here).

    See Background and PERL_IMPLICIT_CONTEXT in perlguts for detailed informationon the ramifications of building Perl with this option.

    1. NOTE: PERL_IMPLICIT_CONTEXT is automatically enabled whenever Perl is built
    2. with one of -Dusethreads, -Dusemultiplicity, or both. It is not
    3. intended to be enabled by users at this time.
  • PERL_POLLUTE_MALLOC

    Enabling Perl's malloc in release 5.005 and earlier caused the namespace ofthe system's malloc family of functions to be usurped by the Perl versions,since by default they used the same names. Besides causing problems onplatforms that do not allow these functions to be cleanly replaced, thisalso meant that the system versions could not be called in programs thatused Perl's malloc. Previous versions of Perl have allowed this behaviourto be suppressed with the HIDEMYMALLOC and EMBEDMYMALLOC preprocessordefinitions.

    As of release 5.6.0, Perl's malloc family of functions have default namesdistinct from the system versions. You need to explicitly compile perl with-DPERL_POLLUTE_MALLOC to get the older behaviour. HIDEMYMALLOCand EMBEDMYMALLOC have no effect, since the behaviour they enabled is nowthe default.

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

Compatible C Source API Changes

  • PATCHLEVEL is now PERL_VERSION

    The cpp macros PERL_REVISION, PERL_VERSION, and PERL_SUBVERSIONare now available by default from perl.h, and reflect the base revision,patchlevel, and subversion respectively. PERL_REVISION had noprior equivalent, while PERL_VERSION and PERL_SUBVERSION werepreviously available as PATCHLEVEL and SUBVERSION.

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

Binary Incompatibilities

In general, the default build of this release is expected to be binarycompatible for extensions built with the 5.005 release or its maintenanceversions. However, specific platforms may have broken binary compatibilitydue to changes in the defaults used in hints files. Therefore, please besure to always check the platform-specific README files for any notes tothe contrary.

The usethreads or usemultiplicity builds are not binary compatiblewith the corresponding builds in 5.005.

On platforms that require an explicit list of exports (AIX, OS/2 and Windows,among others), purely internal symbols such as parser functions and therun time opcodes are not exported by default. Perl 5.005 used to exportall functions irrespective of whether they were considered part of thepublic API or not.

For the full list of public API functions, see perlapi.

Known Problems

Localizing a tied hash element may leak memory

As of the 5.6.1 release, there is a known leak when code such as thisis executed:

  1. use Tie::Hash;
  2. tie my %tie_hash => 'Tie::StdHash';
  3. ...
  4. local($tie_hash{Foo}) = 1; # leaks

Known test failures

  • 64-bit builds

    Subtest #15 of lib/b.t may fail under 64-bit builds on platforms suchas HP-UX PA64 and Linux IA64. The issue is still being investigated.

    The lib/io_multihomed test may hang in HP-UX if Perl has beenconfigured to be 64-bit. Because other 64-bit platforms do nothang in this test, HP-UX is suspect. All other tests passin 64-bit HP-UX. The test attempts to create and connect to"multihomed" sockets (sockets which have multiple IP addresses).

    Note that 64-bit support is still experimental.

  • Failure of Thread tests

    The subtests 19 and 20 of lib/thr5005.t test are known to fail due tofundamental problems in the 5.005 threading implementation. These arenot new failures--Perl 5.005_0x has the same bugs, but didn't have thesetests. (Note that support for 5.005-style threading remains experimental.)

  • NEXTSTEP 3.3 POSIX test failure

    In NEXTSTEP 3.3p2 the implementation of the strftime(3) in theoperating system libraries is buggy: the %j format numbers the days ofa month starting from zero, which, while being logical to programmers,will cause the subtests 19 to 27 of the lib/posix test may fail.

  • Tru64 (aka Digital UNIX, aka DEC OSF/1) lib/sdbm test failure with gcc

    If compiled with gcc 2.95 the lib/sdbm test will fail (dump core).The cure is to use the vendor cc, it comes with the operating systemand produces good code.

EBCDIC platforms not fully supported

In earlier releases of Perl, EBCDIC environments like OS390 (alsoknown as Open Edition MVS) and VM-ESA were supported. Due to changesrequired by the UTF-8 (Unicode) support, the EBCDIC platforms are notsupported in Perl 5.6.0.

The 5.6.1 release improves support for EBCDIC platforms, but theyare not fully supported yet.

UNICOS/mk CC failures during Configure run

In UNICOS/mk the following errors may appear during the Configure run:

  1. Guessing which symbols your C compiler and preprocessor define...
  2. CC-20 cc: ERROR File = try.c, Line = 3
  3. ...
  4. bad switch yylook 79bad switch yylook 79bad switch yylook 79bad switch yylook 79#ifdef A29K
  5. ...
  6. 4 errors detected in the compilation of "try.c".

The culprit is the broken awk of UNICOS/mk. The effect is fortunatelyrather mild: Perl itself is not adversely affected by the error, onlythe h2ph utility coming with Perl, and that is rather rarely neededthese days.

Arrow operator and arrays

When the left argument to the arrow operator -> is an array, orthe scalar operator operating on an array, the result of theoperation must be considered erroneous. For example:

  1. @x->[2]
  2. scalar(@x)->[2]

These expressions will get run-time errors in some future release ofPerl.

Experimental features

As discussed above, many features are still experimental. Interfaces andimplementation of these features are subject to change, and in extreme cases,even subject to removal in some future release of Perl. These featuresinclude the following:

  • Threads
  • Unicode
  • 64-bit support
  • Lvalue subroutines
  • Weak references
  • The pseudo-hash data type
  • The Compiler suite
  • Internal implementation of file globbing
  • The DB module
  • The regular expression code constructs:

    (?{ code }) and (??{ code })

Obsolete Diagnostics

  • Character class syntax [: :] is reserved for future extensions

    (W) Within regular expression character classes ([]) the syntax beginningwith "[:" and ending with ":]" is reserved for future extensions.If you need to represent those character sequences inside a regularexpression character class, just quote the square brackets with thebackslash: "\[:" and ":\]".

  • Ill-formed logical name |%s| in prime_env_iter

    (W) A warning peculiar to VMS. A logical name was encountered when preparingto iterate over %ENV which violates the syntactic rules governing logicalnames. Because it cannot be translated normally, it is skipped, and will notappear in %ENV. This may be a benign occurrence, as some software packagesmight directly modify logical name tables and introduce nonstandard names,or it may indicate that a logical name table has been corrupted.

  • In string, @%s now must be written as \@%s

    The description of this error used to say:

    1. (Someday it will simply assume that an unbackslashed @
    2. interpolates an array.)

    That day has come, and this fatal error has been removed. It has beenreplaced by a non-fatal warning instead.See Arrays now always interpolate into double-quoted strings fordetails.

  • Probable precedence problem on %s

    (W) The compiler found a bareword where it expected a conditional,which often indicates that an || or && was parsed as part of thelast argument of the previous construct, for example:

    1. open FOO || die;
  • regexp too big

    (F) The current implementation of regular expressions uses shorts asaddress offsets within a string. Unfortunately this means that ifthe regular expression compiles to longer than 32767, it'll blow up.Usually when you want a regular expression this big, there is a betterway to do it with multiple statements. See perlre.

  • Use of "$$<digit>" to mean "${$}<digit>" is deprecated

    (D) Perl versions before 5.004 misinterpreted any type marker followedby "$" and a digit. For example, "$$0" was incorrectly taken to mean"${$}0" instead of "${$0}". This bug is (mostly) fixed in Perl 5.004.

    However, the developers of Perl 5.004 could not fix this bug completely,because at least two widely-used modules depend on the old meaning of"$$0" in a string. So Perl 5.004 still interprets "$$<digit>" in theold (broken) way inside strings; but it generates this message as awarning. And in Perl 5.005, this special treatment will cease.

Reporting Bugs

If you find what you think is a bug, you might check thearticles recently posted to the comp.lang.perl.misc newsgroup.There may also be information at http://www.perl.com/ , the PerlHome Page.

If you believe you have an unreported bug, please run the perlbugprogram included with your release. Be sure to trim your bug downto a tiny but sufficient test case. Your bug report, along with theoutput of perl -V, will be sent off to [email protected] to beanalysed by the Perl porting team.

SEE ALSO

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.

HISTORY

Written by Gurusamy Sarathy <[email protected]>, with manycontributions from The Perl Porters.

Send omissions or corrections to <[email protected]>.

Page index
Source : perldoc.perl.org - Official documentation for the Perl programming language
Site maintained by Jon Allen (JJ)     See the project page for more details
Documentation maintained by the Perl 5 Porters
(Sebelumnya) What is new for perl v5.8.0What's new for perl v5.6.0 (Berikutnya)