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