fix emacs/ptags for PL_* changes
[p5sagit/p5-mst-13.2.git] / pod / perldelta.pod
CommitLineData
01784f0d 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 9=head1 About the new versioning system
10
9cde0e7f 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 22=head1 Incompatible Changes
23
429b3afa 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
30to use them 5.005. See L<INSTALL> for detailed instructions on how to
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
365.004 to 5.005, but you should read L<INSTALL> for a detailed
37discussion of the changes in order to adapt them to your system.
429b3afa 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 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 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 52have very little impact on compatibility. See L<New C<INIT> keyword>,
53L<New C<lock> keyword>, and L<New C<qr//> operator>.
fe61ab85 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 59=head2 C Source Compatibility
60
9cde0e7f 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 66=item Core sources now require ANSI C compiler
67
9cde0e7f 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
88See L<perlguts/API LISTING>.
89
429b3afa 90=item Enabling threads has source compatibility issues
91
9cde0e7f 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
103See L<API Changes for more information>.
104
105=back
106
429b3afa 107=head2 Binary Compatibility
108
109This version is NOT binary compatible with older versions. All extensions
9cde0e7f 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 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 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.
9cde0e7f 138See L<perl> and the individual perl man pages listed therein.
429b3afa 139
01784f0d 140=head1 Core Changes
141
01784f0d 142
429b3afa 143=head2 Threads
144
9cde0e7f 145WARNING: Threading is considered an B<experimental> feature. Details of the
429b3afa 146implementation may change without notice. There are known limitations
9cde0e7f 147and some bugs. These are expected to be fixed in future versions.
429b3afa 148
149See L<README.threads>.
150
151=head2 Compiler
152
9cde0e7f 153WARNING: The Compiler and related tools are considered B<experimental>.
429b3afa 154Features may change without notice, and there are known limitations
9cde0e7f 155and bugs. Since the compiler is fully external to perl, the default
156configuration will build and install it.
429b3afa 157
fe61ab85 158The Compiler produces three different types of transformations of a
159perl program. The C backend generates C code that captures perl's state
160just before execution begins. It eliminates the compile-time overheads
161of the regular perl interpreter, but the run-time performance remains
162comparatively the same. The CC backend generates optimized C code
163equivivalent to the code path at run-time. The CC backend has greater
164potential for big optimizations, but only a few optimizations are
165implemented currently. The Bytecode backend generates a platform
166independent bytecode representation of the interpreter's state
167just before execution. Thus, the Bytecode back end also eliminates
168much of the compilation overhead of the interpreter.
169
170The compiler comes with several valuable utilities.
171
172C<B::Lint> is an experimental module to detect and warn about suspicious
173code, especially the cases that the C<-w> switch does not detect.
174
175C<B::Deparse> can be used to demystify perl code, and understand
176how perl optimizes certain constructs.
177
178C<B::Xref> generates cross reference reports of all definition and use
179of variables, subroutines and formats in a program.
429b3afa 180
fe61ab85 181C<B::Showlex> show the lexical variables used by a subroutine or file
182at a glance.
183
184C<perlcc> is a simple frontend for compiling perl.
429b3afa 185
9cde0e7f 186See C<ext/B/README>, L<B>, and the respective compiler modules.
429b3afa 187
188=head2 Regular Expressions
189
9cde0e7f 190Perl's regular expression engine has been seriously overhauled, and
191many new constructs are supported. Several bugs have been fixed.
192
193Here is an itemized summary:
194
195=over 4
196
197=item Many new and improved optimizations
198
199Changes in the RE engine:
200
201 Unneeded nodes removed;
202 Substrings merged together;
203 New types of nodes to process (SUBEXPR)* and similar expressions
204 quickly, used if the SUBEXPR has no side effects and matches
205 strings of the same length;
206 better optimizations by lookup for constant substrings;
207 Better search for constants substrings anchored by $ ;
208
209Changes in Perl code using RE engine:
210
211 more optimizations to s/longer/short/;
212 study() was not working;
213 /blah/ may be optimized to an analogue of index() if $& $` $' not seen;
214 Unneeded copying of matched-against string removed;
215 Only matched part of the string is copying if $` $' were not seen;
216
217=item Many bug fixes
218
219Note that only the major bug fixes are listed here. See F<Changes> for others.
220
221 Backtracking might not restore start of $3.
222 No feedback if max count for * or + on "complex" subexpression
223 was reached, similarly (but at compile time) for {3,34567}
224 Primitive restrictions on max count introduced to decrease a
225 possibility of a segfault;
226 (ZERO-LENGTH)* could segfault;
227 (ZERO-LENGTH)* was prohibited;
228 Long RE were not allowed;
229 /RE/g could skip matches at the same position after a
230 zero-length match;
231
232=item New regular expression constructs
233
234The following new syntax elements are supported:
235
236 (?<=RE)
237 (?<!RE)
238 (?{ CODE })
239 (?i-x)
240 (?i:RE)
241 (?(COND)YES_RE|NO_RE)
242 (?>RE)
243 \z
244
245=item New operator for precompiled regular expressions
246
247See L<New C<qr//> operator>.
248
249=item Other improvements
250
251 better debugging output (possibly with colors), even from non-debugging Perl;
252 RE engine code now looks like C, not like assembler;
253 behaviour of RE modifiable by `use re' directive;
254 Improved documentation;
255 Test suite significantly extended;
256 Syntax [:^upper:] etc., reserved inside character classes;
257
258=item Incompatible changes
259
260 (?i) localized inside enclosing group;
261 $( is not interpolated into RE any more;
262 /RE/g may match at the same position (with non-zero length)
263 after a zero-length match (bug fix).
264
265=back
266
429b3afa 267See L<perlre> and L<perlop>.
268
269=head2 Improved malloc()
270
271See banner at the beginning of C<malloc.c> for details.
272
273=head2 Quicksort is internally implemented
274
9cde0e7f 275Perl now contains its own highly optimized qsort() routine. The new qsort()
276is resistant to inconsistent comparison functions, so Perl's C<sort()> will
277not provoke coredumps any more when given poorly written sort subroutines.
278(Some C library C<qsort()>s that were being used before used to have this
279problem.) In our testing, the new C<qsort()> required the minimal number
280of pair-wise compares on average, among all known C<qsort()> implementations.
281
429b3afa 282See C<perlfunc/sort>.
283
284=head2 Reliable signals
285
9cde0e7f 286Perl's signal handling is susceptible to random crashes, because signals
287arrive asynchronously, and the Perl runtime is not reentrant at arbitrary
288times.
fe61ab85 289
9cde0e7f 290However, one experimental implementation of reliable signals is available
291when threads are enabled. See C<Thread::Signal>. Also see F<INSTALL> for
292how to build a Perl capable of threads.
429b3afa 293
294=head2 Reliable stack pointers
295
fe61ab85 296The internals now reallocate the perl stack only at predictable times.
429b3afa 297In particular, magic calls never trigger reallocations of the stack,
298because all reentrancy of the runtime is handled using a "stack of stacks".
fe61ab85 299This should improve reliability of cached stack pointers in the internals
300and in XSUBs.
429b3afa 301
407eff0f 302=head2 Behavior of local() on array and hash elements is now well-defined
429b3afa 303
407eff0f 304See L<perlsub/"Temporary Values via local()">.
429b3afa 305
306=head2 C<%!> is transparently tied to the L<Errno> module
307
fe61ab85 308See L<perlvar>, and L<Errno>.
429b3afa 309
310=head2 Pseudo-hashes are supported
311
312See L<perlref>.
313
314=head2 C<EXPR foreach EXPR> is supported
315
316See L<perlsyn>.
317
429b3afa 318=head2 Keywords can be globally overridden
319
320See L<perlsub>.
321
322=head2 C<$^E> is meaningful on Win32
323
324See L<perlvar>.
325
326=head2 C<foreach (1..1000000)> optimized
327
328C<foreach (1..1000000)> is now optimized into a counting loop. It does
329not try to allocate a 1000000-size list anymore.
330
331=head2 C<Foo::> can be used as implicitly quoted package name
332
9cde0e7f 333Barewords caused unintuitive behavior when a subroutine with the same
334name as a package happened to be defined. Thus, C<new Foo @args>,
335use the result of the call to C<Foo()> instead of C<Foo> being treated
336as a literal. The recommended way to write barewords in the indirect
337object slot is C<new Foo:: @args>. Note that the method C<new()> is
338called with a first argument of C<Foo>, not C<Foo::> when you do that.
429b3afa 339
340=head2 C<exists $Foo::{Bar::}> tests existence of a package
341
9cde0e7f 342It was impossible to test for the existence of a package without
343actually creating it before. Now C<exists $Foo::{Bar::}> can be
344used to test if the C<Foo::Bar> namespace has been created.
429b3afa 345
346=head2 Better locale support
347
348See L<perllocale>.
349
7ea97eb9 350=head2 Experimental support for 64-bit platforms
429b3afa 351
7ea97eb9 352Perl5 has always had 64-bit support on systems with 64-bit longs.
353Starting with 5.005, the beginnings of experimental support for systems
354with 32-bit long and 64-bit 'long long' integers has been added.
355If you add -DUSE_LONG_LONG to your ccflags in config.sh (or manually
356define it in perl.h) then perl will be built with 'long long' support.
357There will be many compiler warnings, and the resultant perl may not
358work on all systems. There are many other issues related to
359third-party extensions and libraries. This option exists to allow
360people to work on those issues.
429b3afa 361
362=head2 prototype() returns useful results on builtins
363
364See L<perlfunc/prototype>.
365
1a159553 366=head2 Extended support for exception handling
367
368C<die()> now accepts a reference value, and C<$@> gets set to that
369value in exception traps. This makes it possible to propagate
9cde0e7f 370exception objects. This is an undocumented B<experimental> feature.
1a159553 371
429b3afa 372=head2 Re-blessing in DESTROY() supported for chaining DESTROY() methods
373
374See L<perlobj/Destructors>.
375
376=head2 All C<printf> format conversions are handled internally
377
378See L<perlfunc/printf>.
379
380=head2 New C<INIT> keyword
381
fe61ab85 382C<INIT> subs are like C<BEGIN> and C<END>, but they get run just before
383the perl runtime begins execution. e.g., the Perl Compiler makes use of
384C<INIT> blocks to initialize and resolve pointers to XSUBs.
429b3afa 385
429b3afa 386=head2 New C<lock> keyword
387
fe61ab85 388The C<lock> keyword is the fundamental synchronization primitive
389in threaded perl. When threads are not enabled, it is currently a noop.
390
429b3afa 391To minimize impact on source compatibility this keyword is "weak", i.e., any
392user-defined subroutine of the same name overrides it, unless a C<use Thread>
393has been seen.
394
fe61ab85 395=head2 New C<qr//> operator
396
397The C<qr//> operator, which is syntactically similar to the other quote-like
0a92e3a8 398operators, is used to create precompiled regular expressions. This compiled
fe61ab85 399form can now be explicitly passed around in variables, and interpolated in
0a92e3a8 400other regular expressions. See L<perlop>.
fe61ab85 401
402=head2 C<our> is now a reserved word
403
9cde0e7f 404Calling a subroutine with the name C<our> will now provoke a warning when
405using the C<-w> switch.
406
429b3afa 407=head2 Tied arrays are now fully supported
408
409See L<Tie::Array>.
410
411=head2 Tied handles support is better
412
413Several missing hooks have been added. There is also a new base class for
414TIEARRAY implementations. See L<Tie::Array>.
415
6bb4e6d4 416=head2 4th argument to substr
417
418substr() can now both return and replace in one operation. The optional
4194th argument is the replacement string. See L<perlfunc/substr>.
420
421=head2 Negative LENGTH argument to splice
422
423Splice() with a negative LENGTH argument now work similar to what the
424LENGTH did for substr(). Previously a negative LENGTH was treated as
4250. See L<perlfunc/splice>.
426
407eff0f 427=head2 Magic lvalues are now more magical
428
429When you say something like C<substr($x, 5) = "hi">, the scalar returned
430by substr() is special, in that any modifications to it affect $x.
431(This is called a 'magic lvalue' because an 'lvalue' is something on
432the left side of an assignment.) Normally, this is exactly what you
433would expect to happen, but Perl uses the same magic if you use substr(),
434pos(), or vec() in a context where they might be modified, like taking
435a reference with C<\> or as an argument to a sub that modifies C<@_>.
436In previous versions, this 'magic' only went one way, but now changes
437to the scalar the magic refers to ($x in the above example) affect the
438magic lvalue too. For instance, this code now acts differently:
439
440 $x = "hello";
441 sub printit {
442 $x = "g'bye";
443 print $_[0], "\n";
444 }
445 printit(substr($x, 0, 5));
446
447In previous versions, this would print "hello", but it now prints "g'bye".
448
3bf5f72b 449=head2 E<lt>E<gt> now reads in records
450
451If C<$/> is a referenence to an integer, or a scalar that holds an integer,
452E<lt>E<gt> will read in records instead of lines. For more info, see
453L<perlvar/$/>.
429b3afa 454
455=head1 Supported Platforms
456
457Configure has many incremental improvements. Site-wide policy for building
fe61ab85 458perl can now be made persistent, via Policy.sh. Configure also records
7ea97eb9 459the command-line arguments used in F<config.sh>.
429b3afa 460
461=head2 New Platforms
462
463BeOS is now supported. See L<README.beos>.
464
465DOS is now supported under the DJGPP tools. See L<README.dos>.
466
1d84e8df 467MPE/iX is now supported. See L<README.mpeix>.
468
429b3afa 469=head2 Changes in existing support
470
471Win32 support has been vastly enhanced. Support for Perl Object, a C++
472encapsulation of Perl. GCC and EGCS are now supported on Win32.
9cde0e7f 473See F<README.win32>, aka L<perlwin32>.
429b3afa 474
475VMS configuration system has been rewritten. See L<README.vms>.
476
9cde0e7f 477The hints files for most Unix platforms have seen incremental improvements.
429b3afa 478
479=head1 Modules and Pragmata
480
481=head2 New Modules
482
483=over
484
485=item B
486
9cde0e7f 487Perl compiler and tools. See L<B>.
429b3afa 488
489=item Data::Dumper
490
491A module to pretty print Perl data. See L<Data::Dumper>.
492
493=item Errno
494
495A module to look up errors more conveniently. See L<Errno>.
496
497=item File::Spec
498
499A portable API for file operations.
500
501=item ExtUtils::Installed
502
503Query and manage installed modules.
504
505=item ExtUtils::Packlist
506
507Manipulate .packlist files.
508
509=item Fatal
510
511Make functions/builtins succeed or die.
512
513=item IPC::SysV
514
515Constants and other support infrastructure for System V IPC operations
516in perl.
517
518=item Test
519
520A framework for writing testsuites.
01784f0d 521
429b3afa 522=item Tie::Array
523
524Base class for tied arrays.
525
526=item Tie::Handle
527
528Base class for tied handles.
529
530=item Thread
531
532Perl thread creation, manipulation, and support.
533
534=item attrs
535
536Set subroutine attributes.
537
538=item fields
539
540Compile-time class fields.
541
542=item re
543
544Various pragmata to control behavior of regular expressions.
545
546=back
547
548=head2 Changes in existing modules
549
550=over
551
552=item CGI
553
554CGI has been updated to version 2.42.
555
556=item POSIX
557
558POSIX now has its own platform-specific hints files.
559
560=item DB_File
561
562DB_File supports version 2.x of Berkeley DB. See C<ext/DB_File/Changes>.
563
564=item MakeMaker
565
566MakeMaker now supports writing empty makefiles, provides a way to
567specify that site umask() policy should be honored. There is also
568better support for manipulation of .packlist files, and getting
569information about installed modules.
570
7ea97eb9 571Extensions that have both architecture-dependent and
572architecture-independent files are now always installed completely in
573the architecture-dependent locations. Previously, the shareable parts
574were shared both across architectures and across perl versions and were
575therefore liable to be overwritten with newer versions that might have
576subtle incompatibilities.
577
429b3afa 578=item CPAN
579
9cde0e7f 580See <perlmodinstall> and L<CPAN>.
429b3afa 581
582=item Cwd
583
584Cwd::cwd is faster on most platforms.
585
586=item Benchmark
587
588Keeps better time.
589
590=back
01784f0d 591
592=head1 Utility Changes
593
429b3afa 594h2ph and related utilities have been vastly overhauled.
595
596perlcc, a new experimental front end for the compiler is available.
597
7ea97eb9 598The crude GNU configure emulator is now called configure.gnu.
599
01784f0d 600=head1 Documentation Changes
601
429b3afa 602Config.pm now has a glossary of variables.
603
9cde0e7f 604F<Porting/patching.pod> has detailed instructions on how to create and
429b3afa 605submit patches for perl.
606
9cde0e7f 607L<perlport> specifies guidelines on how to write portably.
608
609L<perlmodinstall> describes how to fetch and install modules from C<CPAN>
610sites.
611
612Some more Perl traps are documented now. See L<perltrap>.
613
429b3afa 614=head1 New Diagnostics
615
616=over
617
618=item Ambiguous call resolved as CORE::%s(), qualify as such or use &
619
620(W) A subroutine you have declared has the same name as a Perl keyword,
621and you have used the name without qualification for calling one or the
622other. Perl decided to call the builtin because the subroutine is
623not imported.
624
625To force interpretation as a subroutine call, either put an ampersand
626before the subroutine name, or qualify the name with its package.
627Alternatively, you can import the subroutine (or pretend that it's
628imported with the C<use subs> pragma).
629
630To silently interpret it as the Perl operator, use the C<CORE::> prefix
631on the operator (e.g. C<CORE::log($x)>) or by declaring the subroutine
632to be an object method (see L<attrs>).
633
634=item Bad index while coercing array into hash
635
636(F) The index looked up in the hash found as the 0'th element of a
637pseudo-hash is not legal. Index values must be at 1 or greater.
638See L<perlref>.
639
640=item Bareword "%s" refers to nonexistent package
641
642(W) You used a qualified bareword of the form C<Foo::>, but
643the compiler saw no other uses of that namespace before that point.
644Perhaps you need to predeclare a package?
645
646=item Can't call method "%s" on an undefined value
647
648(F) You used the syntax of a method call, but the slot filled by the
649object reference or package name contains an undefined value.
650Something like this will reproduce the error:
651
652 $BADREF = 42;
653 process $BADREF 1,2,3;
654 $BADREF->process(1,2,3);
655
656=item Can't coerce array into hash
657
658(F) You used an array where a hash was expected, but the array has no
659information on how to map from keys to array indices. You can do that
660only with arrays that have a hash reference at index 0.
661
662=item Can't goto subroutine from an eval-string
663
664(F) The "goto subroutine" call can't be used to jump out of an eval "string".
665(You can use it to jump out of an eval {BLOCK}, but you probably don't want to.)
666
0ebe0038 667=item Can't localize pseudo-hash element
668
669(F) You said something like C<local $ar-E<gt>{'key'}>, where $ar is
670a reference to a pseudo-hash. That hasn't been implemented yet, but
671you can get a similar effect by localizing the corresponding array
672element directly -- C<local $ar-E<gt>[$ar-E<gt>[0]{'key'}]>.
673
429b3afa 674=item Can't use %%! because Errno.pm is not available
675
676(F) The first time the %! hash is used, perl automatically loads the
677Errno.pm module. The Errno module is expected to tie the %! hash to
678provide symbolic names for C<$!> errno values.
679
429b3afa 680=item Cannot find an opnumber for "%s"
681
682(F) A string of a form C<CORE::word> was given to prototype(), but
683there is no builtin with the name C<word>.
684
685=item Character class syntax [. .] is reserved for future extensions
686
687(W) Within regular expression character classes ([]) the syntax beginning
688with "[." and ending with ".]" is reserved for future extensions.
689If you need to represent those character sequences inside a regular
690expression character class, just quote the square brackets with the
691backslash: "\[." and ".\]".
692
693=item Character class syntax [: :] is reserved for future extensions
694
695(W) Within regular expression character classes ([]) the syntax beginning
696with "[:" and ending with ":]" is reserved for future extensions.
697If you need to represent those character sequences inside a regular
698expression character class, just quote the square brackets with the
699backslash: "\[:" and ":\]".
700
701=item Character class syntax [= =] is reserved for future extensions
702
703(W) Within regular expression character classes ([]) the syntax
704beginning with "[=" and ending with "=]" is reserved for future extensions.
705If you need to represent those character sequences inside a regular
706expression character class, just quote the square brackets with the
707backslash: "\[=" and "=\]".
708
709=item %s: Eval-group in insecure regular expression
710
711(F) Perl detected tainted data when trying to compile a regular expression
712that contains the C<(?{ ... })> zero-width assertion, which is unsafe.
713See L<perlre/(?{ code })>, and L<perlsec>.
714
715=item %s: Eval-group not allowed, use re 'eval'
716
717(F) A regular expression contained the C<(?{ ... })> zero-width assertion,
718but that construct is only allowed when the C<use re 'eval'> pragma is
719in effect. See L<perlre/(?{ code })>.
720
721=item %s: Eval-group not allowed at run time
722
723(F) Perl tried to compile a regular expression containing the C<(?{ ... })>
724zero-width assertion at run time, as it would when the pattern contains
725interpolated values. Since that is a security risk, it is not allowed.
726If you insist, you may still do this by explicitly building the pattern
727from an interpolated string at run time and using that in an eval().
728See L<perlre/(?{ code })>.
729
730=item Explicit blessing to '' (assuming package main)
731
732(W) You are blessing a reference to a zero length string. This has
733the effect of blessing the reference into the package main. This is
734usually not what you want. Consider providing a default target
735package, e.g. bless($ref, $p or 'MyPackage');
736
737=item Illegal hex digit ignored
738
739(W) You may have tried to use a character other than 0 - 9 or A - F in a
740hexadecimal number. Interpretation of the hexadecimal number stopped
741before the illegal character.
742
743=item No such array field
744
745(F) You tried to access an array as a hash, but the field name used is
746not defined. The hash at index 0 should map all valid field names to
747array indices for that to work.
748
749=item No such field "%s" in variable %s of type %s
750
751(F) You tried to access a field of a typed variable where the type
752does not know about the field name. The field names are looked up in
753the %FIELDS hash in the type package at compile time. The %FIELDS hash
754is usually set up with the 'fields' pragma.
755
756=item Out of memory during ridiculously large request
757
758(F) You can't allocate more than 2^31+"small amount" bytes. This error
759is most likely to be caused by a typo in the Perl program. e.g., C<$arr[time]>
760instead of C<$arr[$time]>.
761
762=item Range iterator outside integer range
763
764(F) One (or both) of the numeric arguments to the range operator ".."
765are outside the range which can be represented by integers internally.
766One possible workaround is to force Perl to use magical string
767increment by prepending "0" to your numbers.
768
769=item Recursive inheritance detected while looking for method '%s' in package '%s'
770
771(F) More than 100 levels of inheritance were encountered while invoking a
772method. Probably indicates an unintended loop in your inheritance hierarchy.
773
774=item Reference found where even-sized list expected
775
776(W) You gave a single reference where Perl was expecting a list with
777an even number of elements (for assignment to a hash). This
778usually means that you used the anon hash constructor when you meant
779to use parens. In any case, a hash requires key/value B<pairs>.
780
781 %hash = { one => 1, two => 2, }; # WRONG
782 %hash = [ qw/ an anon array / ]; # WRONG
783 %hash = ( one => 1, two => 2, ); # right
784 %hash = qw( one 1 two 2 ); # also fine
785
786=item Undefined value assigned to typeglob
787
788(W) An undefined value was assigned to a typeglob, a la C<*foo = undef>.
789This does nothing. It's possible that you really mean C<undef *foo>.
790
791=item Use of reserved word "%s" is deprecated
792
793(D) The indicated bareword is a reserved word. Future versions of perl
794may use it as a keyword, so you're better off either explicitly quoting
795the word in a manner appropriate for its context of use, or using a
796different name altogether. The warning can be suppressed for subroutine
797names by either adding a C<&> prefix, or using a package qualifier,
798e.g. C<&our()>, or C<Foo::our()>.
799
800=item perl: warning: Setting locale failed.
801
802(S) The whole warning message will look something like:
803
804 perl: warning: Setting locale failed.
805 perl: warning: Please check that your locale settings:
806 LC_ALL = "En_US",
807 LANG = (unset)
808 are supported and installed on your system.
809 perl: warning: Falling back to the standard locale ("C").
810
811Exactly what were the failed locale settings varies. In the above the
812settings were that the LC_ALL was "En_US" and the LANG had no value.
813This error means that Perl detected that you and/or your system
814administrator have set up the so-called variable system but Perl could
815not use those settings. This was not dead serious, fortunately: there
816is a "default locale" called "C" that Perl can and will use, the
817script will be run. Before you really fix the problem, however, you
818will get the same error message each time you run Perl. How to really
819fix the problem can be found in L<perllocale> section B<LOCALE PROBLEMS>.
820
821=back
822
823
824=head1 Obsolete Diagnostics
825
826=over
6cc33c6d 827
429b3afa 828=item Can't mktemp()
829
830(F) The mktemp() routine failed for some reason while trying to process
831a B<-e> switch. Maybe your /tmp partition is full, or clobbered.
832
833=item Can't write to temp file for B<-e>: %s
834
835(F) The write routine failed for some reason while trying to process
836a B<-e> switch. Maybe your /tmp partition is full, or clobbered.
837
838=item Cannot open temporary file
839
840(F) The create routine failed for some reason while trying to process
841a B<-e> switch. Maybe your /tmp partition is full, or clobbered.
842
429b3afa 843=back
844
01784f0d 845=head1 BUGS
846
847If you find what you think is a bug, you might check the headers of
848recently posted articles in the comp.lang.perl.misc newsgroup.
849There may also be information at http://www.perl.com/perl/, the Perl
850Home Page.
851
852If you believe you have an unreported bug, please run the B<perlbug>
853program included with your release. Make sure you trim your bug down
854to a tiny but sufficient test case. Your bug report, along with the
855output of C<perl -V>, will be sent off to <F<perlbug@perl.com>> to be
856analysed by the Perl porting team.
857
858=head1 SEE ALSO
859
860The F<Changes> file for exhaustive details on what changed.
861
862The F<INSTALL> file for how to build Perl.
863
864The F<README> file for general stuff.
865
866The F<Artistic> and F<Copying> files for copyright information.
867
868=head1 HISTORY
429b3afa 869
9cde0e7f 870Written by Gurusamy Sarathy <F<gsar@umich.edu>>, with many contributions
871from The Perl Porters.
872
873Send omissions or corrections to <F<perlbug@perl.com>>.
874
429b3afa 875=cut