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