You are viewing the version of this documentation from Perl 5.14.3. View the latest version

CONTENTS

NAME

perl5138delta - what is new for perl v5.13.8

DESCRIPTION

This document describes differences between the 5.13.7 release and the 5.13.8 release.

If you are upgrading from an earlier release such as 5.13.6, first read perl5137delta, which describes differences between 5.13.6 and 5.13.7.

Core Enhancements

-d:-foo calls Devel::foo::unimport

The syntax -d:foo was extended in 5.6.1 to make -d:foo=bar equivalent to -MDevel::foo=bar, which expands internally to use Devel::foo 'bar';. perl now allows prefixing the module name with -, with the same semantics as -M, i.e.

-d:-foo

Equivalent to -M-Devel::foo, expands to no Devel::foo;, calls Devel::foo->unimport() if the method exists.

-d:-foo=bar

Equivalent to -M-Devel::foo=bar, expands to no Devel::foo 'bar';, calls Devel::foo->unimport('bar') if the method exists.

This is particularly useful to suppresses the default actions of a Devel::* module's import method whilst still loading it for debugging.

Filehandle method calls load IO::File on demand

When a method call on a filehandle would die because the method cannot be resolved, and IO::File has not been loaded, Perl now loads IO::File via require and attempts method resolution again:

open my $fh, ">", $file;
$fh->binmode(":raw");     # loads IO::File and succeeds

This also works for globs like STDOUT, STDERR and STDIN:

STDOUT->autoflush(1);

Because this on-demand load only happens if method resolution fails, the legacy approach of manually loading an IO::File parent class for partial method support still works as expected:

use IO::Handle;
open my $fh, ">", $file;
$fh->autoflush(1);        # IO::File not loaded

Full functionality for use feature 'unicode_strings'

This release provides full functionality for use feature 'unicode_strings'. Under its scope, all string operations executed and regular expressions compiled (even if executed outside its scope) have Unicode semantics. See feature.

This feature avoids most forms of the "Unicode Bug" (See "The "Unicode Bug"" in perlunicode for details.) If there is a possibility that your code will process Unicode strings, you are strongly encouraged to use this subpragma to avoid nasty surprises.

The availability of this should strongly affect the whole tone of various documents, such as perlunicode and perluniintro, but this work has not been done yet.

Exception Handling Backcompat Hack

When an exception is thrown in an eval BLOCK, $@ is now set before unwinding, as well as being set after unwinding as the eval block exits. This early setting supports code that has historically treated $@ during unwinding as an indicator of whether the unwinding was due to an exception. These modules had been broken by 5.13.1's change from setting $@ early to setting it late. This double setting arrangement is a stopgap until the reason for unwinding can be made properly introspectable. $@ has never been a reliable indicator of the reason for unwinding.

printf-like functions understand post-1980 size modifiers

Perl's printf and sprintf operators, and Perl's internal printf replacement function, now understand the C90 size modifiers "hh" (char), "z" (size_t), and "t" (ptrdiff_t). Also, when compiled with a C99 compiler, Perl now understands the size modifier "j" (intmax_t).

So, for example, on any modern machine, sprintf('%hhd', 257) returns '1'.

DTrace probes now include package name

The DTrace probes now include an additional argument (arg3) which contains the package the subroutine being entered or left was compiled in.

For example using the following DTrace script:

perl$target:::sub-entry
{
    printf("%s::%s\n", copyinstr(arg0), copyinstr(arg3));
}

and then running:

perl -e'sub test { }; test'

DTrace will print:

main::test

Stacked labels

Multiple statement labels can now appear before a single statement.

Incompatible Changes

:= is now a syntax error

Previously my $pi := 4; was exactly equivalent to my $pi : = 4;, with the : being treated as the start of an attribute list, ending before the =. The use of := to mean : = was deprecated in 5.12.0, and is now a syntax error. This will allow the future use of := as a new token.

We find no Perl 5 code on CPAN using this construction, outside the core's tests for it, so we believe that this change will have very little impact on real-world codebases.

If it is absolutely necessary to have empty attribute lists (for example, because of a code generator) then avoid the error by adding a space before the =.

Run-time code block in regular expressions

Code blocks in regular expressions ((?{...}) and (??{...})) used not to inherit any pragmata (strict, warnings, etc.) if the regular expression was compiled at run time as happens in cases like these two:

use re 'eval';
$foo =~ $bar; # when $bar contains (?{...})
$foo =~ /$bar(?{ $finished = 1 })/;

This was a bug, which has now been fixed. But it has the potential to break any code that was relying on this bug.

Deprecations

?PATTERN? is deprecated

?PATTERN? (without the initial m) has been deprecated and now produces a warning. This is to allow future use of ? in new operators. The match-once functionality is still available in the form of m?PATTERN?.

sv_compile_2op() is now deprecated

The sv_compile_2op() API function is now deprecated. Searches suggest that nothing on CPAN is using it, so this should have zero impact.

It attempted to provide an API to compile code down to an optree, but failed to bind correctly to lexicals in the enclosing scope. It's not possible to fix this problem within the constraints of its parameters and return value.

Tie functions on scalars holding typeglobs

Calling a tie function (tie, tied, untie) with a scalar argument acts on a file handle if the scalar happens to hold a typeglob.

This is a long-standing bug that will be removed in Perl 5.16, as there is currently no way to tie the scalar itself when it holds a typeglob, and no way to untie a scalar that has had a typeglob assigned to it.

This bug was fixed in 5.13.7 but, because of the breakage it caused, the fix has been reverted. Now there is a deprecation warning whenever a tie function is used on a handle without an explicit *.

Modules and Pragmata

Updated Modules and Pragmata

Dual-life Modules and Pragmata

These modules were formerly distributed only in the Perl core distribution, and are now dual-lifed (meaning they are now also available separately on CPAN):

Diagnostics

The following additions or changes have been made to diagnostic output, including warnings and fatal error messages. For the complete list of diagnostic messages, see perldiag.

New Diagnostics

Changes to Existing Diagnostics

Configuration and Compilation

Testing

Platform Support

Platform-Specific Notes

NetBSD

The NetBSD hints file has been changed to make the system's malloc the default.

Windows

The option to use an externally-supplied crypt(), or to build with no crypt() at all, has been removed. Perl supplies its own crypt() implementation for Windows, and the political situation that required this part of the distribution to sometimes be omitted is long gone.

Internal Changes

Selected Bug Fixes

Acknowledgements

Perl 5.13.8 represents approximately one month of development since Perl 5.13.7 and contains 38715 lines of changes across 546 files from 38 authors and committers.

Thank you to the following for contributing to this release:

Abhijit Menon-Sen, Abigail, Andreas König, Ben Morrow, Brad Gilbert, brian d foy, Chip Salzenberg, Chris 'BinGOs' Williams, Craig A. Berry, David Golden, David Leadbeater, David Mitchell, Father Chrysostomos, Florian Ragwitz, Goro Fuji, H.Merijn Brand, Jan Dubois, Jerry D. Hedden, Jesse Vincent, John Peacock, Karl Williamson, Lukas Mai, Marvin Humphrey, Max Maischein, Michael Breen, Michael Fig, Nicholas Clark, Nick Cleaton, Paul Evans, Peter J. Holzer, Peter John Acklam, Rafael Garcia-Suarez, Reini Urban, Renee Baecker, Ricardo Signes, Tony Cook, Yves Orton, Zefram

Reporting Bugs

If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/perlbug/ . There may also be information at http://www.perl.org/ , the Perl Home Page.

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

If the bug you are reporting has security implications, which make it inappropriate to send to a publicly archived mailing list, then please send it to perl5-security-report@perl.org. This points to a closed subscription unarchived mailing list, which includes all the core committers, who be able to help assess the impact of issues, figure out a resolution, and help co-ordinate the release of patches to mitigate or fix the problem across all platforms on which Perl is supported. Please only use this address for security issues in the Perl core, not for modules independently distributed on CPAN.

SEE ALSO

The Changes file for an explanation of how to view 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.