5 perldelta - what is new for perl v5.15.1
9 This document describes differences between the 5.15.0 release and
12 If you are upgrading from an earlier release such as 5.14.0, first read
13 L<perl5150delta>, which describes differences between 5.14.0 and
16 =head1 Core Enhancements
18 =head2 C<splice()> doesn't warn when truncating
20 You can now limit the size of an array using C<splice(@a,MAX_LEN)> without
21 worrying about warnings.
23 =head2 The C<\$> prototype accepts any scalar lvalue
25 The C<\$> and C<\[$]> subroutine prototypes now accept any scalar lvalue
26 argument. Previously they only accepted scalars beginning with C<$> and
27 hash and array elements. This change makes them consistent with the way
28 the built-in C<read> and C<recv> functions (among others) parse their
29 arguments. This means that one can override the built-in functions with
30 custom subroutines that parse their arguments the same way.
32 =head2 You can now C<study> more than one string
34 The restriction that you can only have one C<study> active at a time has been
35 removed. You can now usefully C<study> as many strings as you want (until you
38 =head2 The Unicode C<Script_Extensions> property is now supported.
40 New in Unicode 6.0, this is an improved C<Script> property. Details
41 are in L<perlunicode/Scripts>.
43 =head2 DTrace probes for interpreter phase change
45 The C<phase-change> probes will fire when the interpreter's phase
46 changes, which tracks the C<${^GLOBAL_PHASE}> variable. C<arg0> is
47 the new phase name; C<arg1> is the old one. This is useful mostly
48 for limiting your instrumentation to one or more of: compile time,
49 run time, destruct time.
53 Many new functions have been added to the API for manipulating lexical
54 pads. See L<perlapi/Pad Data Structures> for more information.
56 =head1 Performance Enhancements
62 The short-circuiting operators C<&&>, C<||>, and C<//>, when chained
63 (such as C<$a || $b || $c>), are now considerably faster to short-circuit,
64 due to reduced optree traversal.
68 The implementation of C<s///r> makes one fewer copy of the scalar's value.
72 If a studied scalar is C<split> with a regex, the engine will now take
73 advantage of the C<study> data.
77 C<study> now uses considerably less memory for shorter strings. Strings shorter
78 than 65535 characters use roughly half the memory than previously, strings
79 shorter than 255 characters use roughly one quarter of the memory.
83 Recursive calls to lvalue subroutines in lvalue scalar context use less
88 =head1 Modules and Pragmata
90 =head2 New Modules and Pragmata
96 The logic for parsing, merging, and dumping XS typemaps has been extracted
97 from C<ExtUtils::ParseXS> into a module of its own, L<ExtUtils::Typemaps>.
98 C<ExtUtils::Typemaps> offers an interface to typemap handling outside of
99 the scope of the XS compiler itself.
101 As a first use case of the improved API and extensibility, typemaps can now
102 be included inline in XS code with a HEREDOC-like syntax:
104 TYPEMAP: <<END_TYPEMAP
110 =head2 Updated Modules and Pragmata
116 L<B::Deparse> has been upgrade from version 1.05 to 1.06.
118 It now correctly deparses interpolation of punctuation variables (like
119 C<@*>) that do not interpolate without braces [perl #93990].
123 L<CGI> has been upgraded from version 3.54 to version 3.55.
125 Things that may break your code:
127 C<url()> was fixed to return C<PATH_INFO> when it is explicitly requested
128 with either the path=>1 or path_info=>1 flag.
130 If your code is running under mod_rewrite (or compatible) and you are calling C<self_url()> or
131 you are calling C<url()> and passing C<< path_info=>1 >>, These methods will actually be
132 returning C<PATH_INFO> now, as you have explicitly requested, or has C<self_url()>
133 has requested on your behalf.
135 The C<PATH_INFO> has been omitted in such URLs since the issue was introduced
136 in the 3.12 release in December, 2005.
138 This bug is so old your application may have come to depend on it or
139 workaround it. Check for application before upgrading to this release.
141 Examples of affected method calls:
143 $q->url(-absolute => 1, -query => 1, -path_info => 1 )
145 $q->url(-full=>1,-path=>1)
146 $q->url(-rewrite=>1,-path=>1)
151 L<CPANPLUS> has been upgraded from version 0.9105 to version 0.9108
155 L<Compress::Raw::Bzip2> has been upgraded from version 2.035 to version 2.037
159 L<Compress::Raw::Zlib> has been upgraded from version 2.035 to version 2.037
161 Added offset parameter to CRC32
165 L<Compress::Zlib> has been upgraded from version 2.035 to version 2.037
167 IO::Compress::Zip and IO::Uncompress::Unzip now have support for LZMA (method 14).
168 There is a fix for a CRC issue in IO::Compress::Unzip and it supports Streamed
169 Stored context now. And fixed a Zip64 issue in
170 IO::Compress::Zip when the content size was exactly 0xFFFFFFFF.
174 L<Cwd> has been upgraded from version 3.36 to 3.37, to address an
175 incompatibility with the EPIC debugger.
179 L<ExtUtils::MakeMaker> has been upgraded from version 6.57_05 to version 6.58
183 L<ExtUtils::ParseXS> has been upgraded from version 2.2210 to 3.00_01.
185 Much of L<ExtUtils::ParseXS>, the module behind the XS compiler C<xsubpp>,
186 was rewritten and cleaned up. It has been made somewhat more extensible
187 and now finally uses strictures.
189 The typemap logic has been moved into a separate module,
190 L<ExtUtils::Typemaps>. See L</New Modules and Pragmata>, above.
194 L<HTTP::Tiny> has been upgraded from version 0.012 to version 0.013.
196 Added support for using C<$ENV{http_proxy}> to set the default proxy host.
200 L<IPC::Cmd> has been upgraded from version 0.70 to version 0.72
202 Capturing of command output (both C<STDOUT> and C<STDERR>) is now supported
203 using L<IPC::Open3> on MSWin32 without requiring L<IPC::Run>.
207 L<Locale::Codes> has been upgraded from version 3.16 to version 3.17
209 Added Language Extension codes (langext) and Language Variation codes
210 (langvar) as defined in the IANA language registry.
212 Added language codes from ISO 639-5
214 Added language/script codes from the IANA language subtag
217 Fixed an uninitialized value warning. RT 67438
219 Fixed the return value for the all_XXX_codes and all_XXX_names functions. RT 69100
221 Reorganized modules to move Locale::MODULE to Locale::Codes::MODULE to
222 allow for cleaner future additions. The original four modules (Locale::Language,
223 Locale::Currency, Locale::Country, Locale::Script) will continue to work, but
224 all new sets of codes will be added in the Locale::Codes namespace.
228 L<Math::BigInt::FastCalc> has been upgraded from version 0.28 to version 0.29.
230 The XS code is now compiled with C<PERL_NO_GET_CONTEXT>, which will aid
231 performance under ithreads.
235 L<Module::CoreList> has been upgraded from version 2.51 to 2.53.
237 Some extraneous (and erroneous) entries have been removed
238 [rt.cpan.org #69108].
240 The C<corelist> utility now understands the C<-r> option for
241 displaying Perl release dates.
245 L<Pod::Perldoc> has been upgraded from version 3.15_05 to 3.15_06.
247 The B<-v> option now fetches the right section for C<$0>.
251 L<Pod::Simple> has been upgraded from version 3.16 to version 3.18
255 L<Unicode::Collate> has been upgraded from version 0.76 to version 0.77
257 Applied [perl #93470] silencing compiler warnings with -Wwrite-strings
261 L<Win32API::File> has been upgraded from version 0.1101 to version 0.1200
263 Added SetStdHandle and GetStdHandle functions
267 L<attributes> has been upgraded from version 0.14 to 0.15, as part of the
268 lvalue attribute warnings fix. See L</Selected Bug Fixes>, below.
272 L<diagnostics> has been upgraded from version 1.22 to 1.23.
274 It now knows how to find descriptions for diagnostic messages ending with a
275 dot, instead getting confused by it.
279 L<threads> has been upgraded from version 1.83 to 1.84
281 An unused variable was removed from the XS code.
285 =head2 Removed Modules and Pragmata
291 Perl 4-era .pl libraries
293 Perl used to bundle a handful of library files that predate Perl 5. Most of
294 these files, which have been deprecated since version 5.14.0, have now been
295 removed. If your code still relies on these libraries, you can install them
296 again from L<Perl4::CoreLibs> on CPAN.
302 =head2 New Documentation
306 L<perldtrace> describes Perl's DTrace support, listing the provided probes
307 and gives examples of their use.
309 =head3 L<perl5141delta>
311 The delta file for Perl 5.14.1 has been copied to blead.
313 =head2 Changes to Existing Documentation
319 L<perlxs> was extended with documentation on inline typemaps.
323 L<perlref> has a new L<Circular References|perlref/Circular References>
324 section explaining how circularities may not be freed and how to solve that
325 with weak references.
329 The documentation for smart match in L<perlsyn> has been corrected for the
330 case of C<undef> on the left-hand side. The list of different smart match
331 behaviours had an item in the wrong place.
335 Parts of L<perlapi> were clarified, and Perl equivalents of some C
336 functions have been added as an additional mode of exposition.
340 A few parts of L<perlre> and L<perlrecharclass> were clarified.
346 The following additions or changes have been made to diagnostic output,
347 including warnings and fatal error messages. For the complete list of
348 diagnostic messages, see L<perldiag>.
350 =head2 Changes to Existing Diagnostics
356 The L<Invalid version format|perldiag/"Invalid version format (%s)">
357 error message now says "negative version number" within the parentheses,
358 rather than "non-numeric data", for negative numbers.
363 L<Possible attempt to put comments in qw() list|perldiag/"Possible attempt to put comments in qw() list">
365 L<Possible attempt to separate words with commas|perldiag/"Possible attempt to separate words with commas">
366 are no longer mutually exclusive: the same C<qw> construct may produce
371 Warnings that mention the names of lexical (C<my>) variables with Unicode
372 characters in them now respect the presence or absence of the C<:utf8>
373 layer on the output handle, instead of outputting UTF8 regardless. Also,
374 the correct names are included in the strings passed to C<$SIG{__WARN__}>
375 handlers, rather than the raw UTF8 bytes.
385 F<t/run/dtrace.t> was added to test Perl's DTrace support. This
386 test will only be run if your Perl was built with C<-Dusedtrace>
387 and if calling C<dtrace> actually lets you instrument code. This
388 generally requires being run as root, so this test file is primarily
389 intended for use by the dtrace subcommittee of p5p.
393 F<t/win32/runenv.t> was added to test aspects of Perl's environment
394 variable handling on MSWin32 platforms. Previously, such tests were
395 skipped on MSWin32 platforms.
399 Some bitrot has been fixed in the miniperl test suite, so that it now
400 nearly passes. The minitest is normally only run when building the
401 full perl fails, so it was liable to fall into disrepair making it a
402 less useful debugging tool. When it is fully passing it is hoped to
403 start including it in regular smoke tests, so that future bitrot will
408 =head1 Platform Support
410 =head2 Platform-Specific Notes
418 On Windows 7, 2008 and Vista, C<@INC> is now always properly populated
419 based on the value of PERL5LIB set in the environment. Previously,
420 values of PERL5LIB longer than 32766 bytes were skipped when C<@INC>
421 was being populated. Tests for environment handling were
422 also added (see L</Testing> section). Fixes
423 L<RT #87322|https://rt.perl.org/rt3/Public/Bug/Display.html?id=87322>.
427 =head1 Internal Changes
433 The expermental C<fetch_cop_label> function has been renamed to
438 The C<cop_store_label> function has been added to the API, but is
443 =head1 Selected Bug Fixes
449 Applying the :lvalue attribute to subroutine that is already defined does
450 not work properly, as the attribute changes the way the sub is compiled.
451 Hence, Perl 5.12 began warning when an attempt is made to apply the
452 attribute to an already defined sub. In such cases, the attribute is
455 But the change in 5.12 missed the case where custom attributes are also
456 present: that case still silently and ineffectively applied the attribute.
457 That omission has now been corrected. C<sub foo :lvalue :Whatever> (when
458 C<foo> is already defined) now warns about the :lvalue attribute, and does
461 L<attributes.pm|attributes> has likewise been updated to warn and not apply
466 The remaining discrepancies between explicit and implicit return from
467 lvalue subroutines have been resolved. They mainly involved which error
468 message to display when a read-only value is returned in lvalue context.
469 Also, returning a PADTMP (the result of most built-ins, like C<index>) in
470 lvalue context is now forbidden for explicit return, as it always has been
471 for implicit return. This is not a regression from 5.14, as all the cases
472 in which it could happen where previously syntax errors.
476 Explicitly returning a tied C<my> variable from an lvalue subroutine in
477 list lvalue context used to clear the variable before the assignment could
478 happen. This is something that was missed when explicit return was made to
483 A minor memory leak, introduced in 5.15.0, has been fixed. It would occur
484 when a hash is freed that has had its current iterator deleted
489 The C<prototype> function no longer dies for the C<__FILE__>, C<__LINE__>
490 and C<__PACKAGE__> directives. It now returns an empty-string prototype
491 for them, because they are syntactically very similar to nullary functions
496 C<prototype> now returns C<undef> for all overridable infix operators,
497 such as C<eq>, which are not callable in any way resembling functions.
498 It used to return incorrect prototypes for some and die for others
503 A bug affecting lvalue context propagation through nested lvalue subroutine
504 calls has been fixed. Previously, returning a value in nested rvalue
505 context would be treated as lvalue context by the inner subroutine call,
506 resulting in some values (such as read-only values) being rejected.
510 Some core bugs affecting L<Hash::Util> have been fixed: locking a hash
511 element that is a glob copy no longer causes subsequent assignment to it to
512 corrupt the glob, and unlocking a hash element that holds a copy-on-write
513 scalar no longer causes modifications to that scalar to modify other
514 scalars that were sharing the same string buffer.
518 C<when> blocks are now capable of returning variables declared inside the
519 enclosing C<given> block [perl #93548].
523 A problem with context propagation when a C<do> block is an argument to
524 C<return> has been fixed. It used to cause C<undef> to be returned in
525 some cases of a C<return> inside an C<if> block which itself is followed by
530 Calling C<index> with a tainted constant no longer causes constants in
531 subsequently compiled code to become tainted [perl #64804].
535 Use of lexical (C<my>) variables in code blocks embedded in regular
536 expressions will no longer result in memory corruption or crashes.
538 Nevertheless, these code blocks are still experimental, as there are still
539 problems with the wrong variables being closed over (in loops for instance)
540 and with abnormal exiting (e.g., C<die>) causing memory corruption.
544 The C<SvIsCOW> C macro now returns false for read-only copies of typeglobs,
545 such as those created by:
548 Hash::Util::lock_value %hash, 'elem';
550 It used to return true.
554 Assignment to C<$^A> (the format output accumulator) now recalculates
555 the number of lines output.
559 The regexp optimiser no longer crashes on debugging builds when merging
560 fixed-string nodes with inconvenient contents.
564 =head1 Acknowledgements
566 XXX Generate this with:
568 perl Porting/acknowledgements.pl v5.15.0..HEAD
570 =head1 Reporting Bugs
572 If you find what you think is a bug, you might check the articles
573 recently posted to the comp.lang.perl.misc newsgroup and the perl
574 bug database at http://rt.perl.org/perlbug/ . There may also be
575 information at http://www.perl.org/ , the Perl Home Page.
577 If you believe you have an unreported bug, please run the L<perlbug>
578 program included with your release. Be sure to trim your bug down
579 to a tiny but sufficient test case. Your bug report, along with the
580 output of C<perl -V>, will be sent off to perlbug@perl.org to be
581 analysed by the Perl porting team.
583 If the bug you are reporting has security implications, which make it
584 inappropriate to send to a publicly archived mailing list, then please send
585 it to perl5-security-report@perl.org. This points to a closed subscription
586 unarchived mailing list, which includes
587 all the core committers, who will be able
588 to help assess the impact of issues, figure out a resolution, and help
589 co-ordinate the release of patches to mitigate or fix the problem across all
590 platforms on which Perl is supported. Please only use this address for
591 security issues in the Perl core, not for modules independently
596 The F<Changes> file for an explanation of how to view exhaustive details
599 The F<INSTALL> file for how to build Perl.
601 The F<README> file for general stuff.
603 The F<Artistic> and F<Copying> files for copyright information.