1 | =head1 NAME |
---|
2 | |
---|
3 | perl5005delta - what's new for perl5.005 |
---|
4 | |
---|
5 | =head1 DESCRIPTION |
---|
6 | |
---|
7 | This document describes differences between the 5.004 release and this one. |
---|
8 | |
---|
9 | =head1 About the new versioning system |
---|
10 | |
---|
11 | Perl is now developed on two tracks: a maintenance track that makes |
---|
12 | small, safe updates to released production versions with emphasis on |
---|
13 | compatibility; and a development track that pursues more aggressive |
---|
14 | evolution. Maintenance releases (which should be considered production |
---|
15 | quality) have subversion numbers that run from C<1> to C<49>, and |
---|
16 | development releases (which should be considered "alpha" quality) run |
---|
17 | from C<50> to C<99>. |
---|
18 | |
---|
19 | Perl 5.005 is the combined product of the new dual-track development |
---|
20 | scheme. |
---|
21 | |
---|
22 | =head1 Incompatible Changes |
---|
23 | |
---|
24 | =head2 WARNING: This version is not binary compatible with Perl 5.004. |
---|
25 | |
---|
26 | Starting with Perl 5.004_50 there were many deep and far-reaching changes |
---|
27 | to the language internals. If you have dynamically loaded extensions |
---|
28 | that you built under perl 5.003 or 5.004, you can continue to use them |
---|
29 | with 5.004, but you will need to rebuild and reinstall those extensions |
---|
30 | to use them 5.005. See F<INSTALL> for detailed instructions on how to |
---|
31 | upgrade. |
---|
32 | |
---|
33 | =head2 Default installation structure has changed |
---|
34 | |
---|
35 | The new Configure defaults are designed to allow a smooth upgrade from |
---|
36 | 5.004 to 5.005, but you should read F<INSTALL> for a detailed |
---|
37 | discussion of the changes in order to adapt them to your system. |
---|
38 | |
---|
39 | =head2 Perl Source Compatibility |
---|
40 | |
---|
41 | When none of the experimental features are enabled, there should be |
---|
42 | very few user-visible Perl source compatibility issues. |
---|
43 | |
---|
44 | If threads are enabled, then some caveats apply. C<@_> and C<$_> become |
---|
45 | lexical variables. The effect of this should be largely transparent to |
---|
46 | the user, but there are some boundary conditions under which user will |
---|
47 | need to be aware of the issues. For example, C<local(@_)> results in |
---|
48 | a "Can't localize lexical variable @_ ..." message. This may be enabled |
---|
49 | in a future version. |
---|
50 | |
---|
51 | Some new keywords have been introduced. These are generally expected to |
---|
52 | have very little impact on compatibility. See L<New C<INIT> keyword>, |
---|
53 | L<New C<lock> keyword>, and L<New C<qrE<sol>E<sol>> operator>. |
---|
54 | |
---|
55 | Certain barewords are now reserved. Use of these will provoke a warning |
---|
56 | if you have asked for them with the C<-w> switch. |
---|
57 | See L<C<our> is now a reserved word>. |
---|
58 | |
---|
59 | =head2 C Source Compatibility |
---|
60 | |
---|
61 | There have been a large number of changes in the internals to support |
---|
62 | the new features in this release. |
---|
63 | |
---|
64 | =over 4 |
---|
65 | |
---|
66 | =item * |
---|
67 | |
---|
68 | Core sources now require ANSI C compiler |
---|
69 | |
---|
70 | An ANSI C compiler is now B<required> to build perl. See F<INSTALL>. |
---|
71 | |
---|
72 | =item * |
---|
73 | |
---|
74 | All Perl global variables must now be referenced with an explicit prefix |
---|
75 | |
---|
76 | All Perl global variables that are visible for use by extensions now |
---|
77 | have a C<PL_> prefix. New extensions should C<not> refer to perl globals |
---|
78 | by their unqualified names. To preserve sanity, we provide limited |
---|
79 | backward compatibility for globals that are being widely used like |
---|
80 | C<sv_undef> and C<na> (which should now be written as C<PL_sv_undef>, |
---|
81 | C<PL_na> etc.) |
---|
82 | |
---|
83 | If you find that your XS extension does not compile anymore because a |
---|
84 | perl global is not visible, try adding a C<PL_> prefix to the global |
---|
85 | and rebuild. |
---|
86 | |
---|
87 | It is strongly recommended that all functions in the Perl API that don't |
---|
88 | begin with C<perl> be referenced with a C<Perl_> prefix. The bare function |
---|
89 | names without the C<Perl_> prefix are supported with macros, but this |
---|
90 | support may cease in a future release. |
---|
91 | |
---|
92 | See L<perlapi>. |
---|
93 | |
---|
94 | =item * |
---|
95 | |
---|
96 | Enabling threads has source compatibility issues |
---|
97 | |
---|
98 | Perl built with threading enabled requires extensions to use the new |
---|
99 | C<dTHR> macro to initialize the handle to access per-thread data. |
---|
100 | If you see a compiler error that talks about the variable C<thr> not |
---|
101 | being declared (when building a module that has XS code), you need |
---|
102 | to add C<dTHR;> at the beginning of the block that elicited the error. |
---|
103 | |
---|
104 | The API function C<perl_get_sv("@",FALSE)> should be used instead of |
---|
105 | directly accessing perl globals as C<GvSV(errgv)>. The API call is |
---|
106 | backward compatible with existing perls and provides source compatibility |
---|
107 | with threading is enabled. |
---|
108 | |
---|
109 | See L<"C Source Compatibility"> for more information. |
---|
110 | |
---|
111 | =back |
---|
112 | |
---|
113 | =head2 Binary Compatibility |
---|
114 | |
---|
115 | This version is NOT binary compatible with older versions. All extensions |
---|
116 | will need to be recompiled. Further binaries built with threads enabled |
---|
117 | are incompatible with binaries built without. This should largely be |
---|
118 | transparent to the user, as all binary incompatible configurations have |
---|
119 | their own unique architecture name, and extension binaries get installed at |
---|
120 | unique locations. This allows coexistence of several configurations in |
---|
121 | the same directory hierarchy. See F<INSTALL>. |
---|
122 | |
---|
123 | =head2 Security fixes may affect compatibility |
---|
124 | |
---|
125 | A few taint leaks and taint omissions have been corrected. This may lead |
---|
126 | to "failure" of scripts that used to work with older versions. Compiling |
---|
127 | with -DINCOMPLETE_TAINTS provides a perl with minimal amounts of changes |
---|
128 | to the tainting behavior. But note that the resulting perl will have |
---|
129 | known insecurities. |
---|
130 | |
---|
131 | Oneliners with the C<-e> switch do not create temporary files anymore. |
---|
132 | |
---|
133 | =head2 Relaxed new mandatory warnings introduced in 5.004 |
---|
134 | |
---|
135 | Many new warnings that were introduced in 5.004 have been made |
---|
136 | optional. Some of these warnings are still present, but perl's new |
---|
137 | features make them less often a problem. See L<New Diagnostics>. |
---|
138 | |
---|
139 | =head2 Licensing |
---|
140 | |
---|
141 | Perl has a new Social Contract for contributors. See F<Porting/Contract>. |
---|
142 | |
---|
143 | The license included in much of the Perl documentation has changed. |
---|
144 | Most of the Perl documentation was previously under the implicit GNU |
---|
145 | General Public License or the Artistic License (at the user's choice). |
---|
146 | Now much of the documentation unambiguously states the terms under which |
---|
147 | it may be distributed. Those terms are in general much less restrictive |
---|
148 | than the GNU GPL. See L<perl> and the individual perl manpages listed |
---|
149 | therein. |
---|
150 | |
---|
151 | =head1 Core Changes |
---|
152 | |
---|
153 | |
---|
154 | =head2 Threads |
---|
155 | |
---|
156 | WARNING: Threading is considered an B<experimental> feature. Details of the |
---|
157 | implementation may change without notice. There are known limitations |
---|
158 | and some bugs. These are expected to be fixed in future versions. |
---|
159 | |
---|
160 | See F<README.threads>. |
---|
161 | |
---|
162 | =head2 Compiler |
---|
163 | |
---|
164 | WARNING: The Compiler and related tools are considered B<experimental>. |
---|
165 | Features may change without notice, and there are known limitations |
---|
166 | and bugs. Since the compiler is fully external to perl, the default |
---|
167 | configuration will build and install it. |
---|
168 | |
---|
169 | The Compiler produces three different types of transformations of a |
---|
170 | perl program. The C backend generates C code that captures perl's state |
---|
171 | just before execution begins. It eliminates the compile-time overheads |
---|
172 | of the regular perl interpreter, but the run-time performance remains |
---|
173 | comparatively the same. The CC backend generates optimized C code |
---|
174 | equivalent to the code path at run-time. The CC backend has greater |
---|
175 | potential for big optimizations, but only a few optimizations are |
---|
176 | implemented currently. The Bytecode backend generates a platform |
---|
177 | independent bytecode representation of the interpreter's state |
---|
178 | just before execution. Thus, the Bytecode back end also eliminates |
---|
179 | much of the compilation overhead of the interpreter. |
---|
180 | |
---|
181 | The compiler comes with several valuable utilities. |
---|
182 | |
---|
183 | C<B::Lint> is an experimental module to detect and warn about suspicious |
---|
184 | code, especially the cases that the C<-w> switch does not detect. |
---|
185 | |
---|
186 | C<B::Deparse> can be used to demystify perl code, and understand |
---|
187 | how perl optimizes certain constructs. |
---|
188 | |
---|
189 | C<B::Xref> generates cross reference reports of all definition and use |
---|
190 | of variables, subroutines and formats in a program. |
---|
191 | |
---|
192 | C<B::Showlex> show the lexical variables used by a subroutine or file |
---|
193 | at a glance. |
---|
194 | |
---|
195 | C<perlcc> is a simple frontend for compiling perl. |
---|
196 | |
---|
197 | See C<ext/B/README>, L<B>, and the respective compiler modules. |
---|
198 | |
---|
199 | =head2 Regular Expressions |
---|
200 | |
---|
201 | Perl's regular expression engine has been seriously overhauled, and |
---|
202 | many new constructs are supported. Several bugs have been fixed. |
---|
203 | |
---|
204 | Here is an itemized summary: |
---|
205 | |
---|
206 | =over 4 |
---|
207 | |
---|
208 | =item Many new and improved optimizations |
---|
209 | |
---|
210 | Changes in the RE engine: |
---|
211 | |
---|
212 | Unneeded nodes removed; |
---|
213 | Substrings merged together; |
---|
214 | New types of nodes to process (SUBEXPR)* and similar expressions |
---|
215 | quickly, used if the SUBEXPR has no side effects and matches |
---|
216 | strings of the same length; |
---|
217 | Better optimizations by lookup for constant substrings; |
---|
218 | Better search for constants substrings anchored by $ ; |
---|
219 | |
---|
220 | Changes in Perl code using RE engine: |
---|
221 | |
---|
222 | More optimizations to s/longer/short/; |
---|
223 | study() was not working; |
---|
224 | /blah/ may be optimized to an analogue of index() if $& $` $' not seen; |
---|
225 | Unneeded copying of matched-against string removed; |
---|
226 | Only matched part of the string is copying if $` $' were not seen; |
---|
227 | |
---|
228 | =item Many bug fixes |
---|
229 | |
---|
230 | Note that only the major bug fixes are listed here. See F<Changes> for others. |
---|
231 | |
---|
232 | Backtracking might not restore start of $3. |
---|
233 | No feedback if max count for * or + on "complex" subexpression |
---|
234 | was reached, similarly (but at compile time) for {3,34567} |
---|
235 | Primitive restrictions on max count introduced to decrease a |
---|
236 | possibility of a segfault; |
---|
237 | (ZERO-LENGTH)* could segfault; |
---|
238 | (ZERO-LENGTH)* was prohibited; |
---|
239 | Long REs were not allowed; |
---|
240 | /RE/g could skip matches at the same position after a |
---|
241 | zero-length match; |
---|
242 | |
---|
243 | =item New regular expression constructs |
---|
244 | |
---|
245 | The following new syntax elements are supported: |
---|
246 | |
---|
247 | (?<=RE) |
---|
248 | (?<!RE) |
---|
249 | (?{ CODE }) |
---|
250 | (?i-x) |
---|
251 | (?i:RE) |
---|
252 | (?(COND)YES_RE|NO_RE) |
---|
253 | (?>RE) |
---|
254 | \z |
---|
255 | |
---|
256 | =item New operator for precompiled regular expressions |
---|
257 | |
---|
258 | See L<New C<qrE<sol>E<sol>> operator>. |
---|
259 | |
---|
260 | =item Other improvements |
---|
261 | |
---|
262 | Better debugging output (possibly with colors), |
---|
263 | even from non-debugging Perl; |
---|
264 | RE engine code now looks like C, not like assembler; |
---|
265 | Behaviour of RE modifiable by `use re' directive; |
---|
266 | Improved documentation; |
---|
267 | Test suite significantly extended; |
---|
268 | Syntax [:^upper:] etc., reserved inside character classes; |
---|
269 | |
---|
270 | =item Incompatible changes |
---|
271 | |
---|
272 | (?i) localized inside enclosing group; |
---|
273 | $( is not interpolated into RE any more; |
---|
274 | /RE/g may match at the same position (with non-zero length) |
---|
275 | after a zero-length match (bug fix). |
---|
276 | |
---|
277 | =back |
---|
278 | |
---|
279 | See L<perlre> and L<perlop>. |
---|
280 | |
---|
281 | =head2 Improved malloc() |
---|
282 | |
---|
283 | See banner at the beginning of C<malloc.c> for details. |
---|
284 | |
---|
285 | =head2 Quicksort is internally implemented |
---|
286 | |
---|
287 | Perl now contains its own highly optimized qsort() routine. The new qsort() |
---|
288 | is resistant to inconsistent comparison functions, so Perl's C<sort()> will |
---|
289 | not provoke coredumps any more when given poorly written sort subroutines. |
---|
290 | (Some C library C<qsort()>s that were being used before used to have this |
---|
291 | problem.) In our testing, the new C<qsort()> required the minimal number |
---|
292 | of pair-wise compares on average, among all known C<qsort()> implementations. |
---|
293 | |
---|
294 | See C<perlfunc/sort>. |
---|
295 | |
---|
296 | =head2 Reliable signals |
---|
297 | |
---|
298 | Perl's signal handling is susceptible to random crashes, because signals |
---|
299 | arrive asynchronously, and the Perl runtime is not reentrant at arbitrary |
---|
300 | times. |
---|
301 | |
---|
302 | However, one experimental implementation of reliable signals is available |
---|
303 | when threads are enabled. See C<Thread::Signal>. Also see F<INSTALL> for |
---|
304 | how to build a Perl capable of threads. |
---|
305 | |
---|
306 | =head2 Reliable stack pointers |
---|
307 | |
---|
308 | The internals now reallocate the perl stack only at predictable times. |
---|
309 | In particular, magic calls never trigger reallocations of the stack, |
---|
310 | because all reentrancy of the runtime is handled using a "stack of stacks". |
---|
311 | This should improve reliability of cached stack pointers in the internals |
---|
312 | and in XSUBs. |
---|
313 | |
---|
314 | =head2 More generous treatment of carriage returns |
---|
315 | |
---|
316 | Perl used to complain if it encountered literal carriage returns in |
---|
317 | scripts. Now they are mostly treated like whitespace within program text. |
---|
318 | Inside string literals and here documents, literal carriage returns are |
---|
319 | ignored if they occur paired with linefeeds, or get interpreted as whitespace |
---|
320 | if they stand alone. This behavior means that literal carriage returns |
---|
321 | in files should be avoided. You can get the older, more compatible (but |
---|
322 | less generous) behavior by defining the preprocessor symbol |
---|
323 | C<PERL_STRICT_CR> when building perl. Of course, all this has nothing |
---|
324 | whatever to do with how escapes like C<\r> are handled within strings. |
---|
325 | |
---|
326 | Note that this doesn't somehow magically allow you to keep all text files |
---|
327 | in DOS format. The generous treatment only applies to files that perl |
---|
328 | itself parses. If your C compiler doesn't allow carriage returns in |
---|
329 | files, you may still be unable to build modules that need a C compiler. |
---|
330 | |
---|
331 | =head2 Memory leaks |
---|
332 | |
---|
333 | C<substr>, C<pos> and C<vec> don't leak memory anymore when used in lvalue |
---|
334 | context. Many small leaks that impacted applications that embed multiple |
---|
335 | interpreters have been fixed. |
---|
336 | |
---|
337 | =head2 Better support for multiple interpreters |
---|
338 | |
---|
339 | The build-time option C<-DMULTIPLICITY> has had many of the details |
---|
340 | reworked. Some previously global variables that should have been |
---|
341 | per-interpreter now are. With care, this allows interpreters to call |
---|
342 | each other. See the C<PerlInterp> extension on CPAN. |
---|
343 | |
---|
344 | =head2 Behavior of local() on array and hash elements is now well-defined |
---|
345 | |
---|
346 | See L<perlsub/"Temporary Values via local()">. |
---|
347 | |
---|
348 | =head2 C<%!> is transparently tied to the L<Errno> module |
---|
349 | |
---|
350 | See L<perlvar>, and L<Errno>. |
---|
351 | |
---|
352 | =head2 Pseudo-hashes are supported |
---|
353 | |
---|
354 | See L<perlref>. |
---|
355 | |
---|
356 | =head2 C<EXPR foreach EXPR> is supported |
---|
357 | |
---|
358 | See L<perlsyn>. |
---|
359 | |
---|
360 | =head2 Keywords can be globally overridden |
---|
361 | |
---|
362 | See L<perlsub>. |
---|
363 | |
---|
364 | =head2 C<$^E> is meaningful on Win32 |
---|
365 | |
---|
366 | See L<perlvar>. |
---|
367 | |
---|
368 | =head2 C<foreach (1..1000000)> optimized |
---|
369 | |
---|
370 | C<foreach (1..1000000)> is now optimized into a counting loop. It does |
---|
371 | not try to allocate a 1000000-size list anymore. |
---|
372 | |
---|
373 | =head2 C<Foo::> can be used as implicitly quoted package name |
---|
374 | |
---|
375 | Barewords caused unintuitive behavior when a subroutine with the same |
---|
376 | name as a package happened to be defined. Thus, C<new Foo @args>, |
---|
377 | use the result of the call to C<Foo()> instead of C<Foo> being treated |
---|
378 | as a literal. The recommended way to write barewords in the indirect |
---|
379 | object slot is C<new Foo:: @args>. Note that the method C<new()> is |
---|
380 | called with a first argument of C<Foo>, not C<Foo::> when you do that. |
---|
381 | |
---|
382 | =head2 C<exists $Foo::{Bar::}> tests existence of a package |
---|
383 | |
---|
384 | It was impossible to test for the existence of a package without |
---|
385 | actually creating it before. Now C<exists $Foo::{Bar::}> can be |
---|
386 | used to test if the C<Foo::Bar> namespace has been created. |
---|
387 | |
---|
388 | =head2 Better locale support |
---|
389 | |
---|
390 | See L<perllocale>. |
---|
391 | |
---|
392 | =head2 Experimental support for 64-bit platforms |
---|
393 | |
---|
394 | Perl5 has always had 64-bit support on systems with 64-bit longs. |
---|
395 | Starting with 5.005, the beginnings of experimental support for systems |
---|
396 | with 32-bit long and 64-bit 'long long' integers has been added. |
---|
397 | If you add -DUSE_LONG_LONG to your ccflags in config.sh (or manually |
---|
398 | define it in perl.h) then perl will be built with 'long long' support. |
---|
399 | There will be many compiler warnings, and the resultant perl may not |
---|
400 | work on all systems. There are many other issues related to |
---|
401 | third-party extensions and libraries. This option exists to allow |
---|
402 | people to work on those issues. |
---|
403 | |
---|
404 | =head2 prototype() returns useful results on builtins |
---|
405 | |
---|
406 | See L<perlfunc/prototype>. |
---|
407 | |
---|
408 | =head2 Extended support for exception handling |
---|
409 | |
---|
410 | C<die()> now accepts a reference value, and C<$@> gets set to that |
---|
411 | value in exception traps. This makes it possible to propagate |
---|
412 | exception objects. This is an undocumented B<experimental> feature. |
---|
413 | |
---|
414 | =head2 Re-blessing in DESTROY() supported for chaining DESTROY() methods |
---|
415 | |
---|
416 | See L<perlobj/Destructors>. |
---|
417 | |
---|
418 | =head2 All C<printf> format conversions are handled internally |
---|
419 | |
---|
420 | See L<perlfunc/printf>. |
---|
421 | |
---|
422 | =head2 New C<INIT> keyword |
---|
423 | |
---|
424 | C<INIT> subs are like C<BEGIN> and C<END>, but they get run just before |
---|
425 | the perl runtime begins execution. e.g., the Perl Compiler makes use of |
---|
426 | C<INIT> blocks to initialize and resolve pointers to XSUBs. |
---|
427 | |
---|
428 | =head2 New C<lock> keyword |
---|
429 | |
---|
430 | The C<lock> keyword is the fundamental synchronization primitive |
---|
431 | in threaded perl. When threads are not enabled, it is currently a noop. |
---|
432 | |
---|
433 | To minimize impact on source compatibility this keyword is "weak", i.e., any |
---|
434 | user-defined subroutine of the same name overrides it, unless a C<use Thread> |
---|
435 | has been seen. |
---|
436 | |
---|
437 | =head2 New C<qr//> operator |
---|
438 | |
---|
439 | The C<qr//> operator, which is syntactically similar to the other quote-like |
---|
440 | operators, is used to create precompiled regular expressions. This compiled |
---|
441 | form can now be explicitly passed around in variables, and interpolated in |
---|
442 | other regular expressions. See L<perlop>. |
---|
443 | |
---|
444 | =head2 C<our> is now a reserved word |
---|
445 | |
---|
446 | Calling a subroutine with the name C<our> will now provoke a warning when |
---|
447 | using the C<-w> switch. |
---|
448 | |
---|
449 | =head2 Tied arrays are now fully supported |
---|
450 | |
---|
451 | See L<Tie::Array>. |
---|
452 | |
---|
453 | =head2 Tied handles support is better |
---|
454 | |
---|
455 | Several missing hooks have been added. There is also a new base class for |
---|
456 | TIEARRAY implementations. See L<Tie::Array>. |
---|
457 | |
---|
458 | =head2 4th argument to substr |
---|
459 | |
---|
460 | substr() can now both return and replace in one operation. The optional |
---|
461 | 4th argument is the replacement string. See L<perlfunc/substr>. |
---|
462 | |
---|
463 | =head2 Negative LENGTH argument to splice |
---|
464 | |
---|
465 | splice() with a negative LENGTH argument now work similar to what the |
---|
466 | LENGTH did for substr(). Previously a negative LENGTH was treated as |
---|
467 | 0. See L<perlfunc/splice>. |
---|
468 | |
---|
469 | =head2 Magic lvalues are now more magical |
---|
470 | |
---|
471 | When you say something like C<substr($x, 5) = "hi">, the scalar returned |
---|
472 | by substr() is special, in that any modifications to it affect $x. |
---|
473 | (This is called a 'magic lvalue' because an 'lvalue' is something on |
---|
474 | the left side of an assignment.) Normally, this is exactly what you |
---|
475 | would expect to happen, but Perl uses the same magic if you use substr(), |
---|
476 | pos(), or vec() in a context where they might be modified, like taking |
---|
477 | a reference with C<\> or as an argument to a sub that modifies C<@_>. |
---|
478 | In previous versions, this 'magic' only went one way, but now changes |
---|
479 | to the scalar the magic refers to ($x in the above example) affect the |
---|
480 | magic lvalue too. For instance, this code now acts differently: |
---|
481 | |
---|
482 | $x = "hello"; |
---|
483 | sub printit { |
---|
484 | $x = "g'bye"; |
---|
485 | print $_[0], "\n"; |
---|
486 | } |
---|
487 | printit(substr($x, 0, 5)); |
---|
488 | |
---|
489 | In previous versions, this would print "hello", but it now prints "g'bye". |
---|
490 | |
---|
491 | =head2 <> now reads in records |
---|
492 | |
---|
493 | If C<$/> is a reference to an integer, or a scalar that holds an integer, |
---|
494 | <> will read in records instead of lines. For more info, see |
---|
495 | L<perlvar/$E<sol>>. |
---|
496 | |
---|
497 | =head1 Supported Platforms |
---|
498 | |
---|
499 | Configure has many incremental improvements. Site-wide policy for building |
---|
500 | perl can now be made persistent, via Policy.sh. Configure also records |
---|
501 | the command-line arguments used in F<config.sh>. |
---|
502 | |
---|
503 | =head2 New Platforms |
---|
504 | |
---|
505 | BeOS is now supported. See F<README.beos>. |
---|
506 | |
---|
507 | DOS is now supported under the DJGPP tools. See F<README.dos> (installed |
---|
508 | as L<perldos> on some systems). |
---|
509 | |
---|
510 | MiNT is now supported. See F<README.mint>. |
---|
511 | |
---|
512 | MPE/iX is now supported. See F<README.mpeix>. |
---|
513 | |
---|
514 | MVS (aka OS390, aka Open Edition) is now supported. See F<README.os390> |
---|
515 | (installed as L<perlos390> on some systems). |
---|
516 | |
---|
517 | Stratus VOS is now supported. See F<README.vos>. |
---|
518 | |
---|
519 | =head2 Changes in existing support |
---|
520 | |
---|
521 | Win32 support has been vastly enhanced. Support for Perl Object, a C++ |
---|
522 | encapsulation of Perl. GCC and EGCS are now supported on Win32. |
---|
523 | See F<README.win32>, aka L<perlwin32>. |
---|
524 | |
---|
525 | VMS configuration system has been rewritten. See F<README.vms> (installed |
---|
526 | as L<README_vms> on some systems). |
---|
527 | |
---|
528 | The hints files for most Unix platforms have seen incremental improvements. |
---|
529 | |
---|
530 | =head1 Modules and Pragmata |
---|
531 | |
---|
532 | =head2 New Modules |
---|
533 | |
---|
534 | =over 4 |
---|
535 | |
---|
536 | =item B |
---|
537 | |
---|
538 | Perl compiler and tools. See L<B>. |
---|
539 | |
---|
540 | =item Data::Dumper |
---|
541 | |
---|
542 | A module to pretty print Perl data. See L<Data::Dumper>. |
---|
543 | |
---|
544 | =item Dumpvalue |
---|
545 | |
---|
546 | A module to dump perl values to the screen. See L<Dumpvalue>. |
---|
547 | |
---|
548 | =item Errno |
---|
549 | |
---|
550 | A module to look up errors more conveniently. See L<Errno>. |
---|
551 | |
---|
552 | =item File::Spec |
---|
553 | |
---|
554 | A portable API for file operations. |
---|
555 | |
---|
556 | =item ExtUtils::Installed |
---|
557 | |
---|
558 | Query and manage installed modules. |
---|
559 | |
---|
560 | =item ExtUtils::Packlist |
---|
561 | |
---|
562 | Manipulate .packlist files. |
---|
563 | |
---|
564 | =item Fatal |
---|
565 | |
---|
566 | Make functions/builtins succeed or die. |
---|
567 | |
---|
568 | =item IPC::SysV |
---|
569 | |
---|
570 | Constants and other support infrastructure for System V IPC operations |
---|
571 | in perl. |
---|
572 | |
---|
573 | =item Test |
---|
574 | |
---|
575 | A framework for writing testsuites. |
---|
576 | |
---|
577 | =item Tie::Array |
---|
578 | |
---|
579 | Base class for tied arrays. |
---|
580 | |
---|
581 | =item Tie::Handle |
---|
582 | |
---|
583 | Base class for tied handles. |
---|
584 | |
---|
585 | =item Thread |
---|
586 | |
---|
587 | Perl thread creation, manipulation, and support. |
---|
588 | |
---|
589 | =item attrs |
---|
590 | |
---|
591 | Set subroutine attributes. |
---|
592 | |
---|
593 | =item fields |
---|
594 | |
---|
595 | Compile-time class fields. |
---|
596 | |
---|
597 | =item re |
---|
598 | |
---|
599 | Various pragmata to control behavior of regular expressions. |
---|
600 | |
---|
601 | =back |
---|
602 | |
---|
603 | =head2 Changes in existing modules |
---|
604 | |
---|
605 | =over 4 |
---|
606 | |
---|
607 | =item Benchmark |
---|
608 | |
---|
609 | You can now run tests for I<x> seconds instead of guessing the right |
---|
610 | number of tests to run. |
---|
611 | |
---|
612 | Keeps better time. |
---|
613 | |
---|
614 | =item Carp |
---|
615 | |
---|
616 | Carp has a new function cluck(). cluck() warns, like carp(), but also adds |
---|
617 | a stack backtrace to the error message, like confess(). |
---|
618 | |
---|
619 | =item CGI |
---|
620 | |
---|
621 | CGI has been updated to version 2.42. |
---|
622 | |
---|
623 | =item Fcntl |
---|
624 | |
---|
625 | More Fcntl constants added: F_SETLK64, F_SETLKW64, O_LARGEFILE for |
---|
626 | large (more than 4G) file access (the 64-bit support is not yet |
---|
627 | working, though, so no need to get overly excited), Free/Net/OpenBSD |
---|
628 | locking behaviour flags F_FLOCK, F_POSIX, Linux F_SHLCK, and |
---|
629 | O_ACCMODE: the mask of O_RDONLY, O_WRONLY, and O_RDWR. |
---|
630 | |
---|
631 | =item Math::Complex |
---|
632 | |
---|
633 | The accessors methods Re, Im, arg, abs, rho, theta, methods can |
---|
634 | ($z->Re()) now also act as mutators ($z->Re(3)). |
---|
635 | |
---|
636 | =item Math::Trig |
---|
637 | |
---|
638 | A little bit of radial trigonometry (cylindrical and spherical) added, |
---|
639 | for example the great circle distance. |
---|
640 | |
---|
641 | =item POSIX |
---|
642 | |
---|
643 | POSIX now has its own platform-specific hints files. |
---|
644 | |
---|
645 | =item DB_File |
---|
646 | |
---|
647 | DB_File supports version 2.x of Berkeley DB. See C<ext/DB_File/Changes>. |
---|
648 | |
---|
649 | =item MakeMaker |
---|
650 | |
---|
651 | MakeMaker now supports writing empty makefiles, provides a way to |
---|
652 | specify that site umask() policy should be honored. There is also |
---|
653 | better support for manipulation of .packlist files, and getting |
---|
654 | information about installed modules. |
---|
655 | |
---|
656 | Extensions that have both architecture-dependent and |
---|
657 | architecture-independent files are now always installed completely in |
---|
658 | the architecture-dependent locations. Previously, the shareable parts |
---|
659 | were shared both across architectures and across perl versions and were |
---|
660 | therefore liable to be overwritten with newer versions that might have |
---|
661 | subtle incompatibilities. |
---|
662 | |
---|
663 | =item CPAN |
---|
664 | |
---|
665 | See L<perlmodinstall> and L<CPAN>. |
---|
666 | |
---|
667 | =item Cwd |
---|
668 | |
---|
669 | Cwd::cwd is faster on most platforms. |
---|
670 | |
---|
671 | =back |
---|
672 | |
---|
673 | =head1 Utility Changes |
---|
674 | |
---|
675 | C<h2ph> and related utilities have been vastly overhauled. |
---|
676 | |
---|
677 | C<perlcc>, a new experimental front end for the compiler is available. |
---|
678 | |
---|
679 | The crude GNU C<configure> emulator is now called C<configure.gnu> to |
---|
680 | avoid trampling on C<Configure> under case-insensitive filesystems. |
---|
681 | |
---|
682 | C<perldoc> used to be rather slow. The slower features are now optional. |
---|
683 | In particular, case-insensitive searches need the C<-i> switch, and |
---|
684 | recursive searches need C<-r>. You can set these switches in the |
---|
685 | C<PERLDOC> environment variable to get the old behavior. |
---|
686 | |
---|
687 | =head1 Documentation Changes |
---|
688 | |
---|
689 | Config.pm now has a glossary of variables. |
---|
690 | |
---|
691 | F<Porting/patching.pod> has detailed instructions on how to create and |
---|
692 | submit patches for perl. |
---|
693 | |
---|
694 | L<perlport> specifies guidelines on how to write portably. |
---|
695 | |
---|
696 | L<perlmodinstall> describes how to fetch and install modules from C<CPAN> |
---|
697 | sites. |
---|
698 | |
---|
699 | Some more Perl traps are documented now. See L<perltrap>. |
---|
700 | |
---|
701 | L<perlopentut> gives a tutorial on using open(). |
---|
702 | |
---|
703 | L<perlreftut> gives a tutorial on references. |
---|
704 | |
---|
705 | L<perlthrtut> gives a tutorial on threads. |
---|
706 | |
---|
707 | =head1 New Diagnostics |
---|
708 | |
---|
709 | =over 4 |
---|
710 | |
---|
711 | =item Ambiguous call resolved as CORE::%s(), qualify as such or use & |
---|
712 | |
---|
713 | (W) A subroutine you have declared has the same name as a Perl keyword, |
---|
714 | and you have used the name without qualification for calling one or the |
---|
715 | other. Perl decided to call the builtin because the subroutine is |
---|
716 | not imported. |
---|
717 | |
---|
718 | To force interpretation as a subroutine call, either put an ampersand |
---|
719 | before the subroutine name, or qualify the name with its package. |
---|
720 | Alternatively, you can import the subroutine (or pretend that it's |
---|
721 | imported with the C<use subs> pragma). |
---|
722 | |
---|
723 | To silently interpret it as the Perl operator, use the C<CORE::> prefix |
---|
724 | on the operator (e.g. C<CORE::log($x)>) or by declaring the subroutine |
---|
725 | to be an object method (see L<attrs>). |
---|
726 | |
---|
727 | =item Bad index while coercing array into hash |
---|
728 | |
---|
729 | (F) The index looked up in the hash found as the 0'th element of a |
---|
730 | pseudo-hash is not legal. Index values must be at 1 or greater. |
---|
731 | See L<perlref>. |
---|
732 | |
---|
733 | =item Bareword "%s" refers to nonexistent package |
---|
734 | |
---|
735 | (W) You used a qualified bareword of the form C<Foo::>, but |
---|
736 | the compiler saw no other uses of that namespace before that point. |
---|
737 | Perhaps you need to predeclare a package? |
---|
738 | |
---|
739 | =item Can't call method "%s" on an undefined value |
---|
740 | |
---|
741 | (F) You used the syntax of a method call, but the slot filled by the |
---|
742 | object reference or package name contains an undefined value. |
---|
743 | Something like this will reproduce the error: |
---|
744 | |
---|
745 | $BADREF = 42; |
---|
746 | process $BADREF 1,2,3; |
---|
747 | $BADREF->process(1,2,3); |
---|
748 | |
---|
749 | =item Can't check filesystem of script "%s" for nosuid |
---|
750 | |
---|
751 | (P) For some reason you can't check the filesystem of the script for nosuid. |
---|
752 | |
---|
753 | =item Can't coerce array into hash |
---|
754 | |
---|
755 | (F) You used an array where a hash was expected, but the array has no |
---|
756 | information on how to map from keys to array indices. You can do that |
---|
757 | only with arrays that have a hash reference at index 0. |
---|
758 | |
---|
759 | =item Can't goto subroutine from an eval-string |
---|
760 | |
---|
761 | (F) The "goto subroutine" call can't be used to jump out of an eval "string". |
---|
762 | (You can use it to jump out of an eval {BLOCK}, but you probably don't want to.) |
---|
763 | |
---|
764 | =item Can't localize pseudo-hash element |
---|
765 | |
---|
766 | (F) You said something like C<< local $ar->{'key'} >>, where $ar is |
---|
767 | a reference to a pseudo-hash. That hasn't been implemented yet, but |
---|
768 | you can get a similar effect by localizing the corresponding array |
---|
769 | element directly -- C<< local $ar->[$ar->[0]{'key'}] >>. |
---|
770 | |
---|
771 | =item Can't use %%! because Errno.pm is not available |
---|
772 | |
---|
773 | (F) The first time the %! hash is used, perl automatically loads the |
---|
774 | Errno.pm module. The Errno module is expected to tie the %! hash to |
---|
775 | provide symbolic names for C<$!> errno values. |
---|
776 | |
---|
777 | =item Cannot find an opnumber for "%s" |
---|
778 | |
---|
779 | (F) A string of a form C<CORE::word> was given to prototype(), but |
---|
780 | there is no builtin with the name C<word>. |
---|
781 | |
---|
782 | =item Character class syntax [. .] is reserved for future extensions |
---|
783 | |
---|
784 | (W) Within regular expression character classes ([]) the syntax beginning |
---|
785 | with "[." and ending with ".]" is reserved for future extensions. |
---|
786 | If you need to represent those character sequences inside a regular |
---|
787 | expression character class, just quote the square brackets with the |
---|
788 | backslash: "\[." and ".\]". |
---|
789 | |
---|
790 | =item Character class syntax [: :] is reserved for future extensions |
---|
791 | |
---|
792 | (W) Within regular expression character classes ([]) the syntax beginning |
---|
793 | with "[:" and ending with ":]" is reserved for future extensions. |
---|
794 | If you need to represent those character sequences inside a regular |
---|
795 | expression character class, just quote the square brackets with the |
---|
796 | backslash: "\[:" and ":\]". |
---|
797 | |
---|
798 | =item Character class syntax [= =] is reserved for future extensions |
---|
799 | |
---|
800 | (W) Within regular expression character classes ([]) the syntax |
---|
801 | beginning with "[=" and ending with "=]" is reserved for future extensions. |
---|
802 | If you need to represent those character sequences inside a regular |
---|
803 | expression character class, just quote the square brackets with the |
---|
804 | backslash: "\[=" and "=\]". |
---|
805 | |
---|
806 | =item %s: Eval-group in insecure regular expression |
---|
807 | |
---|
808 | (F) Perl detected tainted data when trying to compile a regular expression |
---|
809 | that contains the C<(?{ ... })> zero-width assertion, which is unsafe. |
---|
810 | See L<perlre/(?{ code })>, and L<perlsec>. |
---|
811 | |
---|
812 | =item %s: Eval-group not allowed, use re 'eval' |
---|
813 | |
---|
814 | (F) A regular expression contained the C<(?{ ... })> zero-width assertion, |
---|
815 | but that construct is only allowed when the C<use re 'eval'> pragma is |
---|
816 | in effect. See L<perlre/(?{ code })>. |
---|
817 | |
---|
818 | =item %s: Eval-group not allowed at run time |
---|
819 | |
---|
820 | (F) Perl tried to compile a regular expression containing the C<(?{ ... })> |
---|
821 | zero-width assertion at run time, as it would when the pattern contains |
---|
822 | interpolated values. Since that is a security risk, it is not allowed. |
---|
823 | If you insist, you may still do this by explicitly building the pattern |
---|
824 | from an interpolated string at run time and using that in an eval(). |
---|
825 | See L<perlre/(?{ code })>. |
---|
826 | |
---|
827 | =item Explicit blessing to '' (assuming package main) |
---|
828 | |
---|
829 | (W) You are blessing a reference to a zero length string. This has |
---|
830 | the effect of blessing the reference into the package main. This is |
---|
831 | usually not what you want. Consider providing a default target |
---|
832 | package, e.g. bless($ref, $p || 'MyPackage'); |
---|
833 | |
---|
834 | =item Illegal hex digit ignored |
---|
835 | |
---|
836 | (W) You may have tried to use a character other than 0 - 9 or A - F in a |
---|
837 | hexadecimal number. Interpretation of the hexadecimal number stopped |
---|
838 | before the illegal character. |
---|
839 | |
---|
840 | =item No such array field |
---|
841 | |
---|
842 | (F) You tried to access an array as a hash, but the field name used is |
---|
843 | not defined. The hash at index 0 should map all valid field names to |
---|
844 | array indices for that to work. |
---|
845 | |
---|
846 | =item No such field "%s" in variable %s of type %s |
---|
847 | |
---|
848 | (F) You tried to access a field of a typed variable where the type |
---|
849 | does not know about the field name. The field names are looked up in |
---|
850 | the %FIELDS hash in the type package at compile time. The %FIELDS hash |
---|
851 | is usually set up with the 'fields' pragma. |
---|
852 | |
---|
853 | =item Out of memory during ridiculously large request |
---|
854 | |
---|
855 | (F) You can't allocate more than 2^31+"small amount" bytes. This error |
---|
856 | is most likely to be caused by a typo in the Perl program. e.g., C<$arr[time]> |
---|
857 | instead of C<$arr[$time]>. |
---|
858 | |
---|
859 | =item Range iterator outside integer range |
---|
860 | |
---|
861 | (F) One (or both) of the numeric arguments to the range operator ".." |
---|
862 | are outside the range which can be represented by integers internally. |
---|
863 | One possible workaround is to force Perl to use magical string |
---|
864 | increment by prepending "0" to your numbers. |
---|
865 | |
---|
866 | =item Recursive inheritance detected while looking for method '%s' %s |
---|
867 | |
---|
868 | (F) More than 100 levels of inheritance were encountered while invoking a |
---|
869 | method. Probably indicates an unintended loop in your inheritance hierarchy. |
---|
870 | |
---|
871 | =item Reference found where even-sized list expected |
---|
872 | |
---|
873 | (W) You gave a single reference where Perl was expecting a list with |
---|
874 | an even number of elements (for assignment to a hash). This |
---|
875 | usually means that you used the anon hash constructor when you meant |
---|
876 | to use parens. In any case, a hash requires key/value B<pairs>. |
---|
877 | |
---|
878 | %hash = { one => 1, two => 2, }; # WRONG |
---|
879 | %hash = [ qw/ an anon array / ]; # WRONG |
---|
880 | %hash = ( one => 1, two => 2, ); # right |
---|
881 | %hash = qw( one 1 two 2 ); # also fine |
---|
882 | |
---|
883 | =item Undefined value assigned to typeglob |
---|
884 | |
---|
885 | (W) An undefined value was assigned to a typeglob, a la C<*foo = undef>. |
---|
886 | This does nothing. It's possible that you really mean C<undef *foo>. |
---|
887 | |
---|
888 | =item Use of reserved word "%s" is deprecated |
---|
889 | |
---|
890 | (D) The indicated bareword is a reserved word. Future versions of perl |
---|
891 | may use it as a keyword, so you're better off either explicitly quoting |
---|
892 | the word in a manner appropriate for its context of use, or using a |
---|
893 | different name altogether. The warning can be suppressed for subroutine |
---|
894 | names by either adding a C<&> prefix, or using a package qualifier, |
---|
895 | e.g. C<&our()>, or C<Foo::our()>. |
---|
896 | |
---|
897 | =item perl: warning: Setting locale failed. |
---|
898 | |
---|
899 | (S) The whole warning message will look something like: |
---|
900 | |
---|
901 | perl: warning: Setting locale failed. |
---|
902 | perl: warning: Please check that your locale settings: |
---|
903 | LC_ALL = "En_US", |
---|
904 | LANG = (unset) |
---|
905 | are supported and installed on your system. |
---|
906 | perl: warning: Falling back to the standard locale ("C"). |
---|
907 | |
---|
908 | Exactly what were the failed locale settings varies. In the above the |
---|
909 | settings were that the LC_ALL was "En_US" and the LANG had no value. |
---|
910 | This error means that Perl detected that you and/or your system |
---|
911 | administrator have set up the so-called variable system but Perl could |
---|
912 | not use those settings. This was not dead serious, fortunately: there |
---|
913 | is a "default locale" called "C" that Perl can and will use, the |
---|
914 | script will be run. Before you really fix the problem, however, you |
---|
915 | will get the same error message each time you run Perl. How to really |
---|
916 | fix the problem can be found in L<perllocale/"LOCALE PROBLEMS">. |
---|
917 | |
---|
918 | =back |
---|
919 | |
---|
920 | |
---|
921 | =head1 Obsolete Diagnostics |
---|
922 | |
---|
923 | =over 4 |
---|
924 | |
---|
925 | =item Can't mktemp() |
---|
926 | |
---|
927 | (F) The mktemp() routine failed for some reason while trying to process |
---|
928 | a B<-e> switch. Maybe your /tmp partition is full, or clobbered. |
---|
929 | |
---|
930 | Removed because B<-e> doesn't use temporary files any more. |
---|
931 | |
---|
932 | =item Can't write to temp file for B<-e>: %s |
---|
933 | |
---|
934 | (F) The write routine failed for some reason while trying to process |
---|
935 | a B<-e> switch. Maybe your /tmp partition is full, or clobbered. |
---|
936 | |
---|
937 | Removed because B<-e> doesn't use temporary files any more. |
---|
938 | |
---|
939 | =item Cannot open temporary file |
---|
940 | |
---|
941 | (F) The create routine failed for some reason while trying to process |
---|
942 | a B<-e> switch. Maybe your /tmp partition is full, or clobbered. |
---|
943 | |
---|
944 | Removed because B<-e> doesn't use temporary files any more. |
---|
945 | |
---|
946 | =item regexp too big |
---|
947 | |
---|
948 | (F) The current implementation of regular expressions uses shorts as |
---|
949 | address offsets within a string. Unfortunately this means that if |
---|
950 | the regular expression compiles to longer than 32767, it'll blow up. |
---|
951 | Usually when you want a regular expression this big, there is a better |
---|
952 | way to do it with multiple statements. See L<perlre>. |
---|
953 | |
---|
954 | =back |
---|
955 | |
---|
956 | =head1 Configuration Changes |
---|
957 | |
---|
958 | You can use "Configure -Uinstallusrbinperl" which causes installperl |
---|
959 | to skip installing perl also as /usr/bin/perl. This is useful if you |
---|
960 | prefer not to modify /usr/bin for some reason or another but harmful |
---|
961 | because many scripts assume to find Perl in /usr/bin/perl. |
---|
962 | |
---|
963 | =head1 BUGS |
---|
964 | |
---|
965 | If you find what you think is a bug, you might check the headers of |
---|
966 | recently posted articles in the comp.lang.perl.misc newsgroup. |
---|
967 | There may also be information at http://www.perl.com/perl/ , the Perl |
---|
968 | Home Page. |
---|
969 | |
---|
970 | If you believe you have an unreported bug, please run the B<perlbug> |
---|
971 | program included with your release. Make sure you trim your bug down |
---|
972 | to a tiny but sufficient test case. Your bug report, along with the |
---|
973 | output of C<perl -V>, will be sent off to <F<perlbug@perl.com>> to be |
---|
974 | analysed by the Perl porting team. |
---|
975 | |
---|
976 | =head1 SEE ALSO |
---|
977 | |
---|
978 | The F<Changes> file for exhaustive details on what changed. |
---|
979 | |
---|
980 | The F<INSTALL> file for how to build Perl. |
---|
981 | |
---|
982 | The F<README> file for general stuff. |
---|
983 | |
---|
984 | The F<Artistic> and F<Copying> files for copyright information. |
---|
985 | |
---|
986 | =head1 HISTORY |
---|
987 | |
---|
988 | Written by Gurusamy Sarathy <F<gsar@activestate.com>>, with many contributions |
---|
989 | from The Perl Porters. |
---|
990 | |
---|
991 | Send omissions or corrections to <F<perlbug@perl.com>>. |
---|
992 | |
---|
993 | =cut |
---|