Penguin
Blame: perl5004delta(1)
EditPageHistoryDiffInfoLikePages
Annotated edit history of perl5004delta(1) version 2, including all changes. View license author blame.
Rev Author # Line
1 perry 1 PERL5004DELTA
2 !!!PERL5004DELTA
3 NAME
4 DESCRIPTION
5 Supported Environments
6 Core Changes
7 Support for More Operating Systems
8 Pragmata
9 Modules
10 Utility Changes
11 C Language API Changes
12 Documentation Changes
13 New Diagnostics
14 BUGS
15 SEE ALSO
16 HISTORY
17 ----
18 !!NAME
19
20
21 perldelta - what's new for perl5.004
22 !!DESCRIPTION
23
24
25 This document describes differences between the 5.003
26 release (as documented in ''Programming Perl'', second
27 edition--the Camel Book) and this one.
28 !!Supported Environments
29
30
31 Perl5.004 builds out of the box on Unix, Plan 9, LynxOS,
32 VMS , OS/2 ,
33 QNX , AmigaOS, and Windows NT
34 . Perl runs on Windows 95 as well, but it cannot be built
35 there, for lack of a reasonable command
36 interpreter.
37 !!Core Changes
38
39
40 Most importantly, many bugs were fixed, including several
41 security problems. See the ''Changes'' file in the
42 distribution for details.
43
44
45 __List assignment to__ %ENV
46 __works__
47
48
49 %ENV = () and %ENV = @list now work as
50 expected (except on VMS where it generates a
51 fatal error).
52
53
54 __Change to ``Can't locate Foo.pm in__ @INC__''
55 error__
56
57
58 The error ``Can't locate Foo.pm in @INC'' now lists
59 the contents of @INC for easier
60 debugging.
61
62
63 __Compilation option: Binary compatibility with
64 5.003__
65
66
67 There is a new Configure question that asks if you want to
68 maintain binary compatibility with Perl 5.003. If you choose
69 binary compatibility, you do not have to recompile your
70 extensions, but you might have symbol conflicts if you embed
71 Perl in another application, just as in the 5.003 release.
72 By default, binary compatibility is preserved at the expense
73 of symbol table pollution.
74
75
76 __$PERL5OPT environment variable__
77
78
79 You may now put Perl options in the $PERL5OPT
80 environment variable. Unless Perl is running with taint
81 checks, it will interpret this variable as if its contents
82 had appeared on a ``#!perl'' line at the beginning of your
83 script, except that hyphens are optional.
84 PERL5OPT may only be used to set the
85 following switches: __-[[DIMUdmw]__.
86
87
88 __Limitations on -M, -m, and -T options__
89
90
91 The -M and -m options are no longer
92 allowed on the #! line of a script. If a script
93 needs a module, it should invoke it with the use
94 pragma.
95
96
97 The __-T__ option is also forbidden on the #!
98 line of a script, unless it was present on the Perl command
99 line. Due to the way #! works, this usually means
100 that __-T__ must be in the first argument.
101 Thus:
102
103
104 #!/usr/bin/perl -T -w
105 will probably work for an executable script invoked as scriptname, while:
106
107
108 #!/usr/bin/perl -w -T
109 will probably fail under the same conditions. (Non-Unix systems will probably not follow this rule.) But perl scriptname is guaranteed to fail, since then there is no chance of __-T__ being found on the command line before it is found on the #! line.
110
111
112 __More precise warnings__
113
114
115 If you removed the __-w__ option from your Perl 5.003
116 scripts because it made Perl too verbose, we recommend that
117 you try putting it back when you upgrade to Perl 5.004. Each
118 new perl version tends to remove some undesirable warnings,
119 while adding new warnings that may catch bugs in your
120 scripts.
121
122
123 __Deprecated: Inherited__ AUTOLOAD __for
124 non-methods__
125
126
127 Before Perl 5.004, AUTOLOAD functions were looked
128 up as methods (using the @ISA hierarchy), even when
129 the function to be autoloaded was called as a plain function
130 (e.g. Foo::bar()), not a method (e.g.
131 Foo- or
132 $obj-).
133
134
135 Perl 5.005 will use method lookup only for methods'
136 AUTOLOADs. However, there is a significant base of
137 existing code that may be using the old behavior. So, as an
138 interim step, Perl 5.004 issues an optional warning when a
139 non-method uses an inherited AUTOLOAD.
140
141
142 The simple rule is: Inheritance will not work when
143 autoloading non-methods. The simple fix for old code is: In
144 any module that used to depend on inheriting
145 AUTOLOAD for non-methods from a base class named
2 perry 146 !BaseClass, execute *AUTOLOAD =
1 perry 147 during startup.
148
149
150 __Previously deprecated__ %OVERLOAD __is no
151 longer usable__
152
153
154 Using %OVERLOAD to define overloading was
155 deprecated in 5.003. Overloading is now defined using the
156 overload pragma. %OVERLOAD is still used internally
157 but should not be used by Perl scripts. See overload for
158 more details.
159
160
161 __Subroutine arguments created only when they're
162 modified__
163
164
165 In Perl 5.004, nonexistent array and hash elements used as
166 subroutine parameters are brought into existence only if
167 they are actually assigned to (via
168 @_).
169
170
171 Earlier versions of Perl vary in their handling of such
172 arguments. Perl versions 5.002 and 5.003 always brought them
173 into existence. Perl versions 5.000 and 5.001 brought them
174 into existence only if they were not the first argument
175 (which was almost certainly a bug). Earlier versions of Perl
176 never brought them into existence.
177
178
179 For example, given this code:
180
181
182 undef @a; undef %a;
183 sub show { print $_[[0] };
184 sub change { $_[[0]++ };
185 show($a[[2]);
186 change($a{b});
187 After this code executes in Perl 5.004, $a{b} exists but $a[[2] does not. In Perl 5.002 and 5.003, both $a{b} and $a[[2] would have existed (but $a[[2]'s value would have been undefined).
188
189
190 __Group vector changeable with__ $)
191
192
193 The $) special variable has always (well, in Perl
194 5, at least) reflected not only the current effective group,
195 but also the group list as returned by the
196 getgroups() C function (if there is one). However,
197 until this release, there has not been a way to call the
198 setgroups() C function from Perl.
199
200
201 In Perl 5.004, assigning to $) is exactly
202 symmetrical with examining it: The first number in its
203 string value is used as the effective gid; if there are any
204 numbers after the first one, they are passed to the
205 setgroups() C function (if there is
206 one).
207
208
209 __Fixed parsing of $$
210 __
211
212
213 Perl versions before 5.004 misinterpreted any type marker
214 followed by ``$'' and a digit. For example, ``$$0'' was
215 incorrectly taken to mean ``${$}0'' instead of ``${$0}''.
216 This bug is (mostly) fixed in Perl 5.004.
217
218
219 However, the developers of Perl 5.004 could not fix this bug
220 completely, because at least two widely-used modules depend
221 on the old meaning of ``$$0'' in a string. So Perl 5.004
222 still interprets ``$$
223
224
225 __Fixed localization of $
226 __
227
228
229 Perl versions before 5.004 did not always properly localize
230 the regex-related special variables. Perl 5.004 does
231 localize them, as the documentation has always said it
232 should. This may result in $1, $2, etc. no
233 longer being set where existing programs use
234 them.
235
236
237 __No resetting of $. on implicit close__
238
239
240 The documentation for Perl 5.0 has always stated that
241 $. is ''not'' reset when an already-open file
242 handle is reopened with no intervening call to
243 close. Due to a bug, perl versions 5.000 through
244 5.003 ''did'' reset $. under that circumstance;
245 Perl 5.004 does not.
246
247
248 wantarray __may return undef__
249
250
251 The wantarray operator returns true if a subroutine
252 is expected to return a list, and false otherwise. In Perl
253 5.004, wantarray can also return the undefined
254 value if a subroutine's return value will not be used at
255 all, which allows subroutines to avoid a time-consuming
256 calculation of a return value if it isn't going to be
257 used.
258
259
260 eval EXPR __determines value of
261 EXPR in scalar context__
262
263
264 Perl (version 5) used to determine the value of
265 EXPR inconsistently, sometimes incorrectly
266 using the surrounding context for the determination. Now,
267 the value of EXPR (before being parsed by
268 eval) is always determined in a scalar context. Once parsed,
269 it is executed as before, by providing the context that the
270 scope surrounding the eval provided. This change makes the
271 behavior Perl4 compatible, besides fixing bugs resulting
272 from the inconsistent behavior. This program:
273
274
275 @a = qw(time now is time);
276 print eval @a;
277 print '', scalar eval @a;
278 used to print something like ``timenowis8813991094'', but now (and in perl4) prints ``44''.
279
280
281 __Changes to tainting checks__
282
283
284 A bug in previous versions may have failed to detect some
285 insecure conditions when taint checks are turned on. (Taint
286 checks are used in setuid or setgid scripts, or when
287 explicitly turned on with the -T invocation
288 option.) Although it's unlikely, this may cause a
289 previously-working script to now fail -- which should be
290 construed as a blessing, since that indicates a
291 potentially-serious security hole was just
292 plugged.
293
294
295 The new restrictions when tainting include:
296
297
298 No ''glob()'' or ''
299
300
301 These operators may spawn the C shell (csh), which cannot be
302 made safe. This restriction will be lifted in a future
303 version of Perl when globbing is implemented without the use
304 of an external program.
305
306
307 No spawning if tainted $CDPATH, $ENV,
308 $BASH_ENV
309
310
311 These environment variables may alter the behavior of
312 spawned programs (especially shells) in ways that subvert
313 security. So now they are treated as dangerous, in the
314 manner of $IFS and $PATH.
315
316
317 No spawning if tainted $TERM doesn't look like a
318 terminal name
319
320
321 Some termcap libraries do unsafe things with $TERM.
322 However, it would be unnecessarily harsh to treat all
323 $TERM values as unsafe, since only shell
324 metacharacters can cause trouble in $TERM. So a
325 tainted $TERM is considered to be safe if it
326 contains only alphanumerics, underscores, dashes, and
327 colons, and unsafe if it contains other characters
328 (including whitespace).
329
330
331 __New Opcode module and revised Safe
332 module__
333
334
335 A new Opcode module supports the creation, manipulation and
336 application of opcode masks. The revised Safe module has a
337 new API and is implemented using the new
338 Opcode module. Please read the new Opcode and Safe
339 documentation.
340
341
342 __Embedding improvements__
343
344
345 In older versions of Perl it was not possible to create more
346 than one Perl interpreter instance inside a single process
347 without leaking like a sieve and/or crashing. The bugs that
348 caused this behavior have all been fixed. However, you still
349 must take care when embedding Perl in a C program. See the
350 updated perlembed manpage for tips on how to manage your
351 interpreters.
352
353
2 perry 354 __Internal change: !FileHandle class based on IO::*
1 perry 355 classes__
356
357
358 File handles are now stored internally as type IO::Handle.
2 perry 359 The !FileHandle module is still supported for backwards
1 perry 360 compatibility, but it is now merely a front end to the IO::*
361 modules -- specifically, IO::Handle, IO::Seekable, and
362 IO::File. We suggest, but do not require, that you use the
363 IO::* modules in new code.
364
365
366 In harmony with this change, *GLOB{FILEHANDLE} is
367 now just a backward-compatible synonym for
368 *GLOB{IO}.
369
370
371 __Internal change: PerlIO abstraction
372 interface__
373
374
375 It is now possible to build Perl with
376 AT 's sfio IO package
377 instead of stdio. See perlapio for more details, and the
378 ''INSTALL'' file for how to use
379 it.
380
381
382 __New and changed syntax__
383
384
385 $coderef-PARAMS )
386
387
388 A subroutine reference may now be suffixed with an arrow and
389 a (possibly empty) parameter list. This syntax denotes a
390 call of the referenced subroutine, with the given parameters
391 (if any).
392
393
394 This new syntax follows the pattern of
395 $hashref- and $aryref-:
396 You may now write as
397 $subref-. All these arrow terms may be
398 chained; thus, may
399 now be written
400 $table-.
401
402
403 __New and changed builtin constants__
404
405
406 __PACKAGE__
407
408
409 The current package name at compile time, or the undefined
410 value if there is no current package (due to a
411 package; directive). Like __FILE__ and
412 __LINE__, __PACKAGE__ does ''not''
413 interpolate into strings.
414
415
416 __New and changed builtin variables__
417
418
419 $^E
420
421
422 Extended error message on some platforms. (Also known as
423 $EXTENDED_OS_ERROR if you use
424 English).
425
426
427 $^H
428
429
430 The current set of syntax checks enabled by use
431 strict. See the documentation of strict for
432 more details. Not actually new, but newly documented.
433 Because it is intended for internal use by Perl core
434 components, there is no use English long name for
435 this variable.
436
437
438 $^M
439
440
441 By default, running out of memory it is not trappable.
442 However, if compiled for this, Perl may use the contents of
443 $^M as an emergency pool after ''die()''ing with
444 this message. Suppose that your Perl were compiled with
445 -DPERL_EMERGENCY_SBRK and used Perl's malloc.
446 Then
447
448
449 $^M = 'a' x (1
450 would allocate a 64K buffer for use when in emergency. See the ''INSTALL'' file for information on how to enable this option. As a disincentive to casual use of this advanced feature, there is no use English long name for this variable.
451
452
453 __New and changed builtin functions__
454
455
456 delete on slices
457
458
459 This now works. (e.g. delete @ENV{'PATH',
460 'MANPATH'})
461
462
463 flock
464
465
466 is now supported on more platforms, prefers fcntl to lockf
467 when emulating, and always flushes before
468 (un)locking.
469
470
471 printf and sprintf
472
473
474 Perl now implements these functions itself; it doesn't use
475 the C library function ''sprintf()'' any more, except for
476 floating-point numbers, and even then only known flags are
477 allowed. As a result, it is now possible to know which
478 conversions and flags will work, and what they will
479 do.
480
481
482 The new conversions in Perl's ''sprintf()''
483 are:
484
485
486 %i a synonym for %d
487 %p a pointer (the address of the Perl value, in hexadecimal)
488 %n special: *stores* the number of characters output so far
489 into the next variable in the parameter list
490 The new flags that go between the % and the conversion are:
491
492
493 # prefix octal with
494 Also, where a number would appear in the flags, an asterisk (``*'') may be used instead, in which case Perl uses the next item in the parameter list as the given number (that is, as the field width or precision). If a field width obtained through ``*'' is negative, it has the same effect as the '-' flag: left-justification.
495
496
497 See ``sprintf'' in perlfunc for a complete list of
498 conversion and flags.
499
500
501 keys as an lvalue
502
503
504 As an lvalue, keys allows you to increase the
505 number of hash buckets allocated for the given hash. This
506 can gain you a measure of efficiency if you know the hash is
507 going to get big. (This is similar to pre-extending an array
508 by assigning a larger number to $#array.) If you
509 say
510
511
512 keys %hash = 200;
513 then %hash will have at least 200 buckets allocated for it. These buckets will be retained even if you do %hash = (); use undef %hash if you want to free the storage while %hash is still in scope. You can't shrink the number of buckets allocated for the hash using keys in this way (but you needn't worry about doing this by accident, as trying has no effect).
514
515
516 ''my()'' in Control Structures
517
518
519 You can now use ''my()'' (with or without the
520 parentheses) in the control expressions of control
521 structures such as:
522
523
524 while (defined(my $line =
525 if ((my $answer =
526 Also, you can declare a foreach loop control variable as lexical by preceding it with the word ``my''. For example, in:
527
528
529 foreach my $i (1, 2, 3) {
530 some_function();
531 }
532 $i is a lexical variable, and the scope of $i extends to the end of the loop, but not beyond it.
533
534
535 Note that you still cannot use ''my()'' on global
536 punctuation variables such as $_ and the
537 like.
538
539
540 ''pack()'' and ''unpack()''
541
542
543 A new format 'w' represents a BER compressed
544 integer (as defined in ASN .1). Its format is
545 a sequence of one or more bytes, each of which provides
546 seven bits of the total value, with the most significant
547 first. Bit eight of each byte is set, except for the last
548 byte, in which bit eight is clear.
549
550
551 If 'p' or 'P' are given undef as values, they now generate a
552 NULL pointer.
553
554
555 Both ''pack()'' and ''unpack()'' now fail when their
556 templates contain invalid types. (Invalid types used to be
557 ignored.)
558
559
560 ''sysseek()''
561
562
563 The new ''sysseek()'' operator is a variant of
564 ''seek()'' that sets and gets the file's system
565 read/write position, using the lseek(2) system call.
566 It is the only reliable way to seek before using
567 ''sysread()'' or ''syswrite()''. Its return value is
568 the new position, or the undefined value on
569 failure.
570
571
572 use VERSION
573
574
575 If the first argument to use is a number, it is
576 treated as a version number instead of a module name. If the
577 version of the Perl interpreter is less than
578 VERSION , then an error message is printed
579 and Perl exits immediately. Because use occurs at
580 compile time, this check happens immediately during the
581 compilation process, unlike require VERSION, which
582 waits until runtime for the check. This is often useful if
583 you need to check the current Perl version before
584 useing library modules which have changed in
585 incompatible ways from older versions of Perl. (We try not
586 to do this more than we have to.)
587
588
589 use Module VERSION LIST
590
591
592 If the VERSION argument is present between
593 Module and LIST , then the use will
594 call the VERSION method in class Module with
595 the given version as an argument. The default
596 VERSION method, inherited from the
597 UNIVERSAL class, croaks if the given version
598 is larger than the value of the variable
599 $Module::VERSION. (Note that there is not a comma
600 after VERSION !)
601
602
603 This version-checking mechanism is similar to the one
604 currently used in the Exporter module, but it is faster and
605 can be used with modules that don't use the Exporter. It is
606 the recommended method for new code.
607
608
609 prototype( FUNCTION )
610
611
612 Returns the prototype of a function as a string (or
613 undef if the function has no prototype).
614 FUNCTION is a reference to or the name of the
615 function whose prototype you want to retrieve. (Not actually
616 new; just never documented before.)
617
618
619 srand
620
621
622 The default seed for srand, which used to be
623 time, has been changed. Now it's a heady mix of
624 difficult-to-predict system-dependent values, which should
625 be sufficient for most everyday purposes.
626
627
628 Previous to version 5.004, calling rand without
629 first calling srand would yield the same sequence
630 of random numbers on most or all machines. Now, when perl
631 sees that you're calling rand and haven't yet
632 called srand, it calls srand with the
633 default seed. You should still call srand manually
634 if your code might ever be run on a pre-5.004 system, of
635 course, or if you want a seed other than the
636 default.
637
638
639 $_ as Default
640
641
642 Functions documented in the Camel to default to $_
643 now in fact do, and all those that do are so documented in
644 perlfunc.
645
646
647 m//gc does not reset search position on
648 failure
649
650
651 The m//g match iteration construct has always reset
652 its target string's search position (which is visible
653 through the pos operator) when a match fails; as a
654 result, the next m//g match after a failure starts
655 again at the beginning of the string. With Perl 5.004, this
656 reset may be disabled by adding the ``c'' (for ``continue'')
657 modifier, i.e. m//gc. This feature, in conjunction
658 with the G zero-width assertion, makes it possible
659 to chain matches together. See perlop and
660 perlre.
661
662
663 m//x ignores whitespace before ?*+{}
664
665
666 The m//x construct has always been intended to
667 ignore all unescaped whitespace. However, before Perl 5.004,
668 whitespace had the effect of escaping repeat modifiers like
669 ``*'' or ``?''; for example, /a *b/x was
670 (mis)interpreted as /a*b/x. This bug has been fixed
671 in 5.004.
672
673
674 nested sub{} closures work now
675
676
677 Prior to the 5.004 release, nested anonymous functions
678 didn't work right. They do now.
679
680
681 formats work right on changing lexicals
682
683
684 Just like anonymous functions that contain lexical variables
685 that change (like a lexical index variable for a
686 foreach loop), formats now work properly. For
687 example, this silently failed before (printed only zeros),
688 but is fine now:
689
690
691 my $i;
692 foreach $i ( 1 .. 10 ) {
693 write;
694 }
695 format =
696 my i is @#
697 $i
698 .
699 However, it still fails (without a warning) if the foreach is within a subroutine:
700
701
702 my $i;
703 sub foo {
704 foreach $i ( 1 .. 10 ) {
705 write;
706 }
707 }
708 foo;
709 format =
710 my i is @#
711 $i
712 .
713
714
715 __New builtin methods__
716
717
718 The UNIVERSAL package automatically contains the
719 following methods that are inherited by all other
720 classes:
721
722
723 isa( CLASS )
724
725
726 isa returns ''true'' if its object is blessed
727 into a subclass of CLASS
728
729
730 isa is also exportable and can be called as a sub
731 with two arguments. This allows the ability to check what a
732 reference points to. Example:
733
734
735 use UNIVERSAL qw(isa);
736 if(isa($ref, 'ARRAY')) {
737 ...
738 }
739
740
741 can( METHOD )
742
743
744 can checks to see if its object has a method called
745 METHOD, if it does then a reference to the sub is
746 returned; if it does not then ''undef'' is
747 returned.
748
749
750 VERSION ( [[ NEED ]
751 )
752
753
754 VERSION returns the version number of the class
755 (package). If the NEED argument is given then
756 it will check that the current version (as defined by the
757 $VERSION variable in the given package) not less
758 than NEED ; it will die if this is not the
759 case. This method is normally called as a class method. This
760 method is called automatically by the VERSION form
761 of use.
762
763
764 use A 1.2 qw(some imported subs);
765 # implies:
766 A-
767
768
769 __NOTE:__ can directly uses
770 Perl's internal code for method lookup, and isa
771 uses a very similar method and caching strategy. This may
772 cause strange effects if the Perl code dynamically changes
773 @ISA in any package.
774
775
776 You may add other methods to the UNIVERSAL
777 class via Perl or XS code. You do not need to
778 use UNIVERSAL in order to make these methods
779 available to your program. This is necessary only if you
780 wish to have isa available as a plain subroutine in
781 the current package.
782
783
784 __TIEHANDLE now supported__
785
786
787 See perltie for other kinds of ''tie()''s.
788
789
790 TIEHANDLE classname,
791 LIST
792
793
794 This is the constructor for the class. That means it is
795 expected to return an object of some sort. The reference can
796 be used to hold some internal information.
797
798
799 sub TIEHANDLE {
800 print
801
802
803 PRINT this, LIST
804
805
806 This method will be triggered every time the tied handle is
807 printed to. Beyond its self reference it also expects the
808 list that was passed to the print function.
809
810
811 sub PRINT {
812 $r = shift;
813 $$r++;
814 return print join( $, =
815
816
817 PRINTF this, LIST
818
819
820 This method will be triggered every time the tied handle is
821 printed to with the printf() function. Beyond its
822 self reference it also expects the format and list that was
823 passed to the printf function.
824
825
826 sub PRINTF {
827 shift;
828 my $fmt = shift;
829 print sprintf($fmt, @_).
830
831
832 READ this LIST
833
834
835 This method will be called when the handle is read from via
836 the read or sysread
837 functions.
838
839
840 sub READ {
841 $r = shift;
842 my($buf,$len,$offset) = @_;
843 print
844
845
846 READLINE this
847
848
849 This method will be called when the handle is read from. The
850 method should return undef when there is no more
851 data.
852
853
854 sub READLINE {
855 $r = shift;
856 return
857
858
859 GETC this
860
861
862 This method will be called when the getc function
863 is called.
864
865
866 sub GETC { print
867
868
869 DESTROY this
870
871
872 As with the other types of ties, this method will be called
873 when the tied handle is about to be destroyed. This is
874 useful for debugging and possibly for cleaning
875 up.
876
877
878 sub DESTROY {
879 print
880
881
882 __Malloc enhancements__
883
884
885 If perl is compiled with the malloc included with the perl
886 distribution (that is, if perl -V:d_mymalloc is
887 'define') then you can print memory statistics at runtime by
888 running Perl thusly:
889
890
891 env PERL_DEBUG_MSTATS=2 perl your_script_here
892 The value of 2 means to print statistics after compilation and on exit; with a value of 1, the statistics are printed only on exit. (If you want the statistics at an arbitrary time, you'll need to install the optional module Devel::Peek.)
893
894
895 Three new compilation flags are recognized by malloc.c.
896 (They have no effect if perl is compiled with system
897 ''malloc()''.)
898
899
900 -DPERL_EMERGENCY_SBRK
901
902
903 If this macro is defined, running out of memory need not be
904 a fatal error: a memory pool can allocated by assigning to
905 the special variable $^M. See ``$^M''.
906
907
908 -DPACK_MALLOC
909
910
911 Perl memory allocation is by bucket with sizes close to
912 powers of two. Because of these malloc overhead may be big,
913 especially for data of size exactly a power of two. If
914 PACK_MALLOC is defined, perl uses a slightly
915 different algorithm for small allocations (up to 64 bytes
916 long), which makes it possible to have overhead down to 1
917 byte for allocations which are powers of two (and appear
918 quite often).
919
920
921 Expected memory savings (with 8-byte alignment in
922 alignbytes) is about 20% for typical Perl usage.
923 Expected slowdown due to additional malloc overhead is in
924 fractions of a percent (hard to measure, because of the
925 effect of saved memory on speed).
926
927
928 -DTWO_POT_OPTIMIZE
929
930
931 Similarly to PACK_MALLOC, this macro improves
932 allocations of data with size close to a power of two; but
933 this works for big allocations (starting with 16K by
934 default). Such allocations are typical for big hashes and
935 special-purpose scripts, especially image
936 processing.
937
938
939 On recent systems, the fact that perl requires 2M from
940 system for 1M allocation will not affect speed of execution,
941 since the tail of such a chunk is not going to be touched
942 (and thus will not require real memory). However, it may
943 result in a premature out-of-memory error. So if you will be
944 manipulating very large blocks with sizes close to powers of
945 two, it would be wise to define this macro.
946
947
948 Expected saving of memory is 0-100% (100% in applications
949 which require most memory in such 2**n chunks); expected
950 slowdown is negligible.
951
952
953 __Miscellaneous efficiency enhancements__
954
955
956 Functions that have an empty prototype and that do nothing
957 but return a fixed value are now inlined (e.g. sub PI ()
958 { 3.14159 }).
959
960
961 Each unique hash key is only allocated once, no matter how
962 many hashes have an entry with that key. So even if you have
963 100 copies of the same hash, the hash keys never have to be
964 reallocated.
965 !!Support for More Operating Systems
966
967
968 Support for the following operating systems is new in Perl
969 5.004.
970
971
972 __Win32__
973
974
975 Perl 5.004 now includes support for building a ``native''
976 perl under Windows NT , using the Microsoft
977 Visual C ++ compiler (versions 2.0 and above)
978 or the Borland C ++ compiler (versions 5.02
979 and above). The resulting perl can be used under Windows 95
980 (if it is installed in the same directory locations as it
981 got installed in Windows NT ). This port
982 includes support for perl extension building tools like
2 perry 983 !MakeMaker and h2xs, so that many extensions available on the
1 perry 984 Comprehensive Perl Archive Network ( CPAN )
985 can now be readily built under Windows NT .
986 See http://www.perl.com/ for more information on
987 CPAN and ''README .win32''
988 in the perl distribution for more details on how to get
989 started with building this port.
990
991
992 There is also support for building perl under the Cygwin32
993 environment. Cygwin32 is a set of GNU tools
994 that make it possible to compile and run many Unix programs
995 under Windows NT by providing a mostly
996 Unix-like interface for compilation and execution. See
997 ''README .cygwin32'' in the perl
998 distribution for more details on this port and how to obtain
999 the Cygwin32 toolkit.
1000
1001
1002 __Plan 9__
1003
1004
1005 See ''README .plan9'' in the perl
1006 distribution.
1007
1008
1009 __QNX__
1010
1011
1012 See ''README .qnx'' in the perl
1013 distribution.
1014
1015
1016 __AmigaOS__
1017
1018
1019 See ''README .amigaos'' in the perl
1020 distribution.
1021 !!Pragmata
1022
1023
1024 Six new pragmatic modules exist:
1025
1026
1027 use autouse MODULE =
1028
1029
1030 Defers require MODULE until someone calls one of
1031 the specified subroutines (which must be exported by
1032 MODULE ). This pragma should be used with
1033 caution, and only when necessary.
1034
1035
1036 use blib
1037
1038
1039 use blib 'dir'
1040
1041
2 perry 1042 Looks for !MakeMaker-like '''blib''' directory structure
1 perry 1043 starting in ''dir'' (or current directory) and working
1044 back up to five levels of parent directories.
1045
1046
1047 Intended for use on command line with __-M__ option as a
1048 way of testing arbitrary scripts against an uninstalled
1049 version of a package.
1050
1051
1052 use constant NAME =
1053 VALUE
1054
1055
1056 Provides a convenient interface for creating compile-time
1057 constants, See ``Constant Functions'' in
1058 perlsub.
1059
1060
1061 use locale
1062
1063
1064 Tells the compiler to enable (or disable) the use of
1065 POSIX locales for builtin
1066 operations.
1067
1068
1069 When use locale is in effect, the current
1070 LC_CTYPE locale is used for regular
1071 expressions and case mapping; LC_COLLATE for
1072 string ordering; and LC_NUMERIC for numeric
1073 formatting in printf and sprintf (but __not__ in print).
1074 LC_NUMERIC is always used in write, since
1075 lexical scoping of formats is problematic at
1076 best.
1077
1078
1079 Each use locale or no locale affects
1080 statements to the end of the enclosing BLOCK
1081 or, if not inside a BLOCK , to the end of the
1082 current file. Locales can be switched and queried with
1083 ''POSIX::setlocale()''.
1084
1085
1086 See perllocale for more information.
1087
1088
1089 use ops
1090
1091
1092 Disable unsafe opcodes, or any named opcodes, when compiling
1093 Perl code.
1094
1095
1096 use vmsish
1097
1098
1099 Enable VMS-specific language features. Currently, there are
1100 three VMS-specific features available: 'status', which makes
1101 $? and system return genuine
1102 VMS status values instead of emulating
1103 POSIX ; 'exit', which makes exit
1104 take a genuine VMS status value instead of
1105 assuming that exit 1 is an error; and 'time', which
1106 makes all times relative to the local time zone, in the
1107 VMS tradition.
1108 !!Modules
1109
1110
1111 __Required Updates__
1112
1113
1114 Though Perl 5.004 is compatible with almost all modules that
1115 work with Perl 5.003, there are a few
1116 exceptions:
1117
1118
1119 Module Required Version for Perl 5.004
1120 ------ -------------------------------
1121 Filter Filter-1.12
1122 LWP libwww-perl-5.08
1123 Tk Tk400.202 (-w makes noise)
1124 Also, the majordomo mailing list program, version 1.94.1, doesn't work with Perl 5.004 (nor with perl 4), because it executes an invalid regular expression. This bug is fixed in majordomo version 1.94.2.
1125
1126
1127 __Installation directories__
1128
1129
1130 The ''installperl'' script now places the Perl source
1131 files for extensions in the architecture-specific library
1132 directory, which is where the shared libraries for
1133 extensions have always been. This change is intended to
1134 allow administrators to keep the Perl 5.004 library
1135 directory unchanged from a previous version, without running
1136 the risk of binary incompatibility between extensions' Perl
1137 source and shared libraries.
1138
1139
1140 __Module information summary__
1141
1142
1143 Brand new modules, arranged by topic rather than strictly
1144 alphabetically:
1145
1146
1147 CGI.pm Web server interface (
1148 CPAN Interface to Comprehensive Perl Archive Network
2 perry 1149 CPAN::!FirstTime Utility for creating CPAN configuration file
1 perry 1150 CPAN::Nox Runs CPAN while avoiding compiled extensions
1151 IO.pm Top-level interface to IO::* classes
1152 IO/File.pm IO::File extension Perl module
1153 IO/Handle.pm IO::Handle extension Perl module
1154 IO/Pipe.pm IO::Pipe extension Perl module
1155 IO/Seekable.pm IO::Seekable extension Perl module
1156 IO/Select.pm IO::Select extension Perl module
1157 IO/Socket.pm IO::Socket extension Perl module
1158 Opcode.pm Disable named opcodes when compiling Perl code
2 perry 1159 !ExtUtils/Embed.pm Utilities for embedding Perl in C programs
1160 !ExtUtils/testlib.pm Fixes up @INC to use just-built extension
1161 !FindBin.pm Find path of currently executing program
1 perry 1162 Class/Struct.pm Declare struct-like datatypes as Perl classes
1163 File/stat.pm By-name interface to Perl's builtin stat
1164 Net/hostent.pm By-name interface to Perl's builtin gethost*
1165 Net/netent.pm By-name interface to Perl's builtin getnet*
1166 Net/protoent.pm By-name interface to Perl's builtin getproto*
1167 Net/servent.pm By-name interface to Perl's builtin getserv*
1168 Time/gmtime.pm By-name interface to Perl's builtin gmtime
1169 Time/localtime.pm By-name interface to Perl's builtin localtime
1170 Time/tm.pm Internal object for Time::{gm,local}time
1171 User/grent.pm By-name interface to Perl's builtin getgr*
1172 User/pwent.pm By-name interface to Perl's builtin getpw*
2 perry 1173 Tie/!RefHash.pm Base class for tied hashes with references as keys
1 perry 1174 UNIVERSAL.pm Base class for *ALL* classes
1175
1176
1177 __Fcntl__
1178
1179
1180 New constants in the existing Fcntl modules are now
1181 supported, provided that your operating system happens to
1182 support them:
1183
1184
1185 F_GETOWN F_SETOWN
1186 O_ASYNC O_DEFER O_DSYNC O_FSYNC O_SYNC
1187 O_EXLOCK O_SHLOCK
1188 These constants are intended for use with the Perl operators ''sysopen()'' and ''fcntl()'' and the basic database modules like SDBM_File. For the exact meaning of these and other Fcntl constants please refer to your operating system's documentation for ''fcntl()'' and ''open()''.
1189
1190
1191 In addition, the Fcntl module now provides these constants
1192 for use with the Perl operator ''flock()'':
1193
1194
1195 LOCK_SH LOCK_EX LOCK_NB LOCK_UN
1196 These constants are defined in all environments (because where there is no ''flock()'' system call, Perl emulates it). However, for historical reasons, these constants are not exported unless they are explicitly requested with the ``:flock'' tag (e.g. use Fcntl ':flock').
1197
1198
1199 __IO__
1200
1201
1202 The IO module provides a simple mechanism to
1203 load all the IO modules at one go. Currently
1204 this includes:
1205
1206
1207 IO::Handle
1208 IO::Seekable
1209 IO::File
1210 IO::Pipe
1211 IO::Socket
1212 For more information on any of these modules, please see its respective documentation.
1213
1214
1215 __Math::Complex__
1216
1217
1218 The Math::Complex module has been totally rewritten, and now
1219 supports more operations. These are overloaded:
1220
1221
1222 + - * / **
1223 And these functions are now exported:
1224
1225
1226 pi i Re Im arg
1227 log10 logn ln cbrt root
1228 tan
1229 csc sec cot
1230 asin acos atan
1231 acsc asec acot
1232 sinh cosh tanh
1233 csch sech coth
1234 asinh acosh atanh
1235 acsch asech acoth
1236 cplx cplxe
1237
1238
1239 __Math::Trig__
1240
1241
1242 This new module provides a simpler interface to parts of
1243 Math::Complex for those who need trigonometric functions
1244 only for real numbers.
1245
1246
1247 __DB_File__
1248
1249
1250 There have been quite a few changes made to DB_File. Here
1251 are a few of the highlights:
1252
1253
1254 Fixed a handful of bugs.
1255
1256
1257 By public demand, added support for the standard hash
1258 function ''exists()''.
1259
1260
1261 Made it compatible with Berkeley DB
1262 1.86.
1263
1264
1265 Made negative subscripts work with RECNO
1266 interface.
1267
1268
1269 Changed the default flags from O_RDWR to O_CREATO_RDWR and
1270 the default mode from 0640 to 0666.
1271
1272
1273 Made DB_File automatically import the ''open()''
1274 constants (O_RDWR, O_CREAT etc.) from Fcntl, if
1275 available.
1276
1277
1278 Updated documentation.
1279
1280
1281 Refer to the HISTORY section in DB_File.pm
1282 for a complete list of changes. Everything after DB_File
1283 1.01 has been added since 5.003.
1284
1285
1286 __Net::Ping__
1287
1288
1289 Major rewrite - support added for both udp echo and real
1290 icmp pings.
1291
1292
1293 __Object-oriented overrides for builtin
1294 operators__
1295
1296
1297 Many of the Perl builtins returning lists now have
1298 object-oriented overrides. These are:
1299
1300
1301 File::stat
1302 Net::hostent
1303 Net::netent
1304 Net::protoent
1305 Net::servent
1306 Time::gmtime
1307 Time::localtime
1308 User::grent
1309 User::pwent
1310 For example, you can now say
1311
1312
1313 use File::stat;
1314 use User::pwent;
1315 $his = (stat($filename)-
1316 !!Utility Changes
1317
1318
1319 __pod2html__
1320
1321
1322 Sends converted HTML to standard
1323 output
1324
1325
1326 The ''pod2html'' utility included with Perl 5.004 is
1327 entirely new. By default, it sends the converted
1328 HTML to its standard output, instead of
1329 writing it to a file like Perl 5.003's ''pod2html'' did.
1330 Use the __--outfile=FILENAME__ option to write to a
1331 file.
1332
1333
1334 __xsubpp__
1335
1336
1337 void XSUBs now default to returning
1338 nothing
1339
1340
1341 Due to a documentation/implementation bug in previous
1342 versions of Perl, XSUBs with a return type of void
1343 have actually been returning one value. Usually that value
1344 was the GV for the XSUB , but
1345 sometimes it was some already freed or reused value, which
1346 would sometimes lead to program failure.
1347
1348
1349 In Perl 5.004, if an XSUB is declared as
1350 returning void, it actually returns no value, i.e.
1351 an empty list (though there is a backward-compatibility
1352 exception; see below). If your XSUB really
1353 does return an SV , you should give it a
1354 return type of SV *.
1355
1356
1357 For backward compatibility, ''xsubpp'' tries to guess
1358 whether a void XSUB is really
1359 void or if it wants to return an SV *. It
1360 does so by examining the text of the XSUB: if
1361 ''xsubpp'' finds what looks like an assignment to
1362 ST(0), it assumes that the XSUB 's
1363 return type is really SV *.
1364 !!C Language API Changes
1365
1366
1367 gv_fetchmethod and
1368 perl_call_sv
1369
1370
1371 The gv_fetchmethod function finds a method for an
1372 object, just like in Perl 5.003. The GV it
1373 returns may be a method cache entry. However, in Perl 5.004,
1374 method cache entries are not visible to users; therefore,
1375 they can no longer be passed directly to
1376 perl_call_sv. Instead, you should use the
1377 GvCV macro on the GV to extract its
1378 CV , and pass the CV to
1379 perl_call_sv.
1380
1381
1382 The most likely symptom of passing the result of
1383 gv_fetchmethod to perl_call_sv is Perl's
1384 producing an ``Undefined subroutine called'' error on the
1385 ''second'' call to a given method (since there is no
1386 cache on the first call).
1387
1388
1389 perl_eval_pv
1390
1391
1392 A new function handy for eval'ing strings of Perl code
1393 inside C code. This function returns the value from the eval
1394 statement, which can be used instead of fetching globals
1395 from the symbol table. See perlguts, perlembed and perlcall
1396 for details and examples.
1397
1398
1399 Extended API for manipulating
1400 hashes
1401
1402
1403 Internal handling of hash keys has changed. The old
1404 hashtable API is still fully supported, and
1405 will likely remain so. The additions to the
1406 API allow passing keys as SV*s, so
1407 that tied hashes can be given real scalars as keys
1408 rather than plain strings (nontied hashes still can only use
1409 strings as keys). New extensions must use the new hash
1410 access functions and macros if they wish to use SV*
1411 keys. These additions also make it feasible to manipulate
1412 HE*s (hash entries), which can be more efficient.
1413 See perlguts for details.
1414 !!Documentation Changes
1415
1416
1417 Many of the base and library pods were updated. These new
1418 pods are included in section 1:
1419
1420
1421 perldelta
1422
1423
1424 This document.
1425
1426
1427 perlfaq
1428
1429
1430 Frequently asked questions.
1431
1432
1433 perllocale
1434
1435
1436 Locale support (internationalization and
1437 localization).
1438
1439
1440 perltoot
1441
1442
1443 Tutorial on Perl OO programming.
1444
1445
1446 perlapio
1447
1448
1449 Perl internal IO abstraction
1450 interface.
1451
1452
1453 perlmodlib
1454
1455
1456 Perl module library and recommended practice for module
1457 creation. Extracted from perlmod (which is much smaller as a
1458 result).
1459
1460
1461 perldebug
1462
1463
1464 Although not new, this has been massively
1465 updated.
1466
1467
1468 perlsec
1469
1470
1471 Although not new, this has been massively
1472 updated.
1473 !!New Diagnostics
1474
1475
1476 Several new conditions will trigger warnings that were
1477 silent before. Some only affect certain platforms. The
1478 following new warnings and errors outline these. These
1479 messages are classified as follows (listed in increasing
1480 order of desperation):
1481
1482
1483 (W) A warning (optional).
1484 (D) A deprecation (optional).
1485 (S) A severe warning (mandatory).
1486 (F) A fatal error (trappable).
1487 (P) An internal error you should never see (trappable).
1488 (X) A very fatal error (nontrappable).
1489 (A) An alien error message (not generated by Perl).
1490 ``my'' variable %s masks earlier declaration in same scope
1491
1492
1493 (W) A lexical variable has been redeclared in the same
1494 scope, effectively eliminating all access to the previous
1495 instance. This is almost always a typographical error. Note
1496 that the earlier variable will still exist until the end of
1497 the scope or until all closure referents to it are
1498 destroyed.
1499
1500
1501 %s argument is not a HASH element or
1502 slice
1503
1504
1505 (F) The argument to ''delete()'' must be either a hash
1506 element, such as
1507
1508
1509 $foo{$bar}
1510 $ref-
1511 or a hash slice, such as
1512
1513
1514 @foo{$bar, $baz, $xyzzy}
1515 @{$ref-
1516
1517
1518 Allocation too large: %lx
1519
1520
1521 (X) You can't allocate more than 64K on an MS-DOS
1522 machine.
1523
1524
1525 Allocation too large
1526
1527
1528 (F) You can't allocate more than 2^31+``small amount''
1529 bytes.
1530
1531
1532 Applying %s to %s will act on
1533 scalar(%s)
1534
1535
1536 (W) The pattern match (//), substitution (s///), and
1537 transliteration (tr///) operators work on scalar values. If
1538 you apply one of them to an array or a hash, it will convert
1539 the array or hash to a scalar value -- the length of an
1540 array, or the population info of a hash -- and then work on
1541 that scalar value. This is probably not what you meant to
1542 do. See ``grep'' in perlfunc and ``map'' in perlfunc for
1543 alternatives.
1544
1545
1546 Attempt to free nonexistent shared string
1547
1548
1549 (P) Perl maintains a reference counted internal table of
1550 strings to optimize the storage and access of hash keys and
1551 other strings. This indicates someone tried to decrement the
1552 reference count of a string that can no longer be found in
1553 the table.
1554
1555
1556 Attempt to use reference as lvalue in substr
1557
1558
1559 (W) You supplied a reference as the first argument to
1560 ''substr()'' used as an lvalue, which is pretty strange.
1561 Perhaps you forgot to dereference it first. See ``substr''
1562 in perlfunc.
1563
1564
1565 Bareword ``%s'' refers to nonexistent package
1566
1567
1568 (W) You used a qualified bareword of the form
1569 Foo::, but the compiler saw no other uses of that
1570 namespace before that point. Perhaps you need to predeclare
1571 a package?
1572
1573
1574 Can't redefine active sort subroutine
1575 %s
1576
1577
1578 (F) Perl optimizes the internal handling of sort subroutines
1579 and keeps pointers into them. You tried to redefine one such
1580 sort subroutine when it was currently active, which is not
1581 allowed. If you really want to do this, you should write
1582 sort { instead of sort func
1583 @x.
1584
1585
1586 Can't use bareword (``%s'') as %s ref while
1587 ``strict refs'' in use
1588
1589
1590 (F) Only hard references are allowed by ``strict refs''.
1591 Symbolic references are disallowed. See
1592 perlref.
1593
1594
1595 Cannot resolve method `%s' overloading `%s' in package
1596 `%s'
1597
1598
1599 (P) Internal error trying to resolve overloading specified
1600 by a method name (as opposed to a subroutine
1601 reference).
1602
1603
1604 Constant subroutine %s redefined
1605
1606
1607 (S) You redefined a subroutine which had previously been
1608 eligible for inlining. See ``Constant Functions'' in perlsub
1609 for commentary and workarounds.
1610
1611
1612 Constant subroutine %s undefined
1613
1614
1615 (S) You undefined a subroutine which had previously been
1616 eligible for inlining. See ``Constant Functions'' in perlsub
1617 for commentary and workarounds.
1618
1619
1620 Copy method did not return a reference
1621
1622
1623 (F) The method which overloads ``='' is buggy. See ``Copy
1624 Constructor'' in overload.
1625
1626
1627 Died
1628
1629
1630 (F) You passed ''die()'' an empty string (the equivalent
1631 of die ) or you called it with no args
1632 and both $@ and $_ were
1633 empty.
1634
1635
1636 Exiting pseudo-block via %s
1637
1638
1639 (W) You are exiting a rather special block construct (like a
1640 sort block or subroutine) by unconventional means, such as a
1641 goto, or a loop control statement. See ``sort'' in
1642 perlfunc.
1643
1644
1645 Identifier too long
1646
1647
1648 (F) Perl limits identifiers (names for variables, functions,
1649 etc.) to 252 characters for simple names, somewhat more for
1650 compound names (like $A::B). You've exceeded Perl's
1651 limits. Future versions of Perl are likely to eliminate
1652 these arbitrary limitations.
1653
1654
1655 Illegal character %s (carriage return)
1656
1657
1658 (F) A carriage return character was found in the input. This
1659 is an error, and not a warning, because carriage return
1660 characters can break multi-line strings, including here
1661 documents (e.g., print ).
1662
1663
1664 Illegal switch in PERL5OPT:
1665 %s
1666
1667
1668 (X) The PERL5OPT environment variable may
1669 only be used to set the following switches:
1670 __-[[DIMUdmw]__.
1671
1672
1673 Integer overflow in hex number
1674
1675
1676 (S) The literal hex number you have specified is too big for
1677 your architecture. On a 32-bit architecture the largest hex
1678 literal is 0xFFFFFFFF.
1679
1680
1681 Integer overflow in octal number
1682
1683
1684 (S) The literal octal number you have specified is too big
1685 for your architecture. On a 32-bit architecture the largest
1686 octal literal is 037777777777.
1687
1688
1689 internal error: glob failed
1690
1691
1692 (P) Something went wrong with the external program(s) used
1693 for glob and . This may mean
1694 that your csh (C shell) is broken. If so, you should change
1695 all of the csh-related variables in config.sh: If you have
1696 tcsh, make the variables refer to it as if it were csh (e.g.
1697 full_csh='/usr/bin/tcsh'); otherwise, make them all
1698 empty (except that d_csh should be
1699 'undef') so that Perl will think csh is missing. In
1700 either case, after editing config.sh, run ./Configure
1701 -S and rebuild Perl.
1702
1703
1704 Invalid conversion in %s: ``%s''
1705
1706
1707 (W) Perl does not understand the given format conversion.
1708 See ``sprintf'' in perlfunc.
1709
1710
1711 Invalid type in pack: '%s'
1712
1713
1714 (F) The given character is not a valid pack type. See
1715 ``pack'' in perlfunc.
1716
1717
1718 Invalid type in unpack: '%s'
1719
1720
1721 (F) The given character is not a valid unpack type. See
1722 ``unpack'' in perlfunc.
1723
1724
1725 Name ``%s::%s'' used only once: possible typo
1726
1727
1728 (W) Typographical errors often show up as unique variable
1729 names. If you had a good reason for having a unique name,
1730 then just mention it again somehow to suppress the message
1731 (the use vars pragma is provided for just this
1732 purpose).
1733
1734
1735 Null picture in formline
1736
1737
1738 (F) The first argument to formline must be a valid format
1739 picture specification. It was found to be empty, which
1740 probably means you supplied it an uninitialized value. See
1741 perlform.
1742
1743
1744 Offset outside string
1745
1746
1747 (F) You tried to do a read/write/send/recv operation with an
1748 offset pointing outside the buffer. This is difficult to
1749 imagine. The sole exception to this is that
1750 sysread()ing past the buffer will extend the buffer
1751 and zero pad the new area.
1752
1753
1754 Out of memory!
1755
1756
1757 (XF) The ''malloc()'' function returned 0, indicating
1758 there was insufficient remaining memory (or virtual memory)
1759 to satisfy the request.
1760
1761
1762 The request was judged to be small, so the possibility to
1763 trap it depends on the way Perl was compiled. By default it
1764 is not trappable. However, if compiled for this, Perl may
1765 use the contents of $^M as an emergency pool after
1766 ''die()''ing with this message. In this case the error is
1767 trappable ''once''.
1768
1769
1770 Out of memory during request for %s
1771
1772
1773 (F) The ''malloc()'' function returned 0, indicating
1774 there was insufficient remaining memory (or virtual memory)
1775 to satisfy the request. However, the request was judged
1776 large enough (compile-time default is 64K), so a possibility
1777 to shut down by trapping this error is granted.
1778
1779
1780 panic: frexp
1781
1782
1783 (P) The library function ''frexp()'' failed, making
1784 printf(``%f'') impossible.
1785
1786
1787 Possible attempt to put comments in ''qw()''
1788 list
1789
1790
1791 (W) ''qw()'' lists contain items separated by whitespace;
1792 as with literal strings, comment characters are not ignored,
1793 but are instead treated as literal data. (You may have used
1794 different delimiters than the parentheses shown here; braces
1795 are also frequently used.)
1796
1797
1798 You probably wrote something like this:
1799
1800
1801 @list = qw(
1802 a # a comment
1803 b # another comment
1804 );
1805 when you should have written this:
1806
1807
1808 @list = qw(
1809 a
1810 b
1811 );
1812 If you really want comments, build your list the old-fashioned way, with quotes and commas:
1813
1814
1815 @list = (
1816 'a', # a comment
1817 'b', # another comment
1818 );
1819
1820
1821 Possible attempt to separate words with commas
1822
1823
1824 (W) ''qw()'' lists contain items separated by whitespace;
1825 therefore commas aren't needed to separate the items. (You
1826 may have used different delimiters than the parentheses
1827 shown here; braces are also frequently used.)
1828
1829
1830 You probably wrote something like this:
1831
1832
1833 qw! a, b, c !;
1834 which puts literal commas into some of the list items. Write it without commas if you don't want them to appear in your data:
1835
1836
1837 qw! a b c !;
1838
1839
1840 Scalar value @%s{%s} better written as $%s{%s}
1841
1842
1843 (W) You've used a hash slice (indicated by @) to select a
1844 single element of a hash. Generally it's better to ask for a
1845 scalar value (indicated by $). The difference is that
1846 $foo{ always behaves like a scalar, both
1847 when assigning to it and when evaluating its argument, while
1848 @foo{ behaves like a list when you assign
1849 to it, and provides a list context to its subscript, which
1850 can do weird things if you're expecting only one
1851 subscript.
1852
1853
1854 Stub found while resolving method `%s' overloading `%s' in
1855 %s
1856
1857
1858 (P) Overloading resolution over @ISA tree may be
1859 broken by importing stubs. Stubs should never be implicitly
1860 created, but explicit calls to can may break
1861 this.
1862
1863
1864 Too late for ``__-T__'' option
1865
1866
1867 (X) The #! line (or local equivalent) in a Perl script
1868 contains the __-T__ option, but Perl was not invoked with
1869 __-T__ in its argument list. This is an error because, by
1870 the time Perl discovers a __-T__ in a script, it's too
1871 late to properly taint everything from the environment. So
1872 Perl gives up.
1873
1874
1875 untie attempted while %d inner references still
1876 exist
1877
1878
1879 (W) A copy of the object returned from tie (or
1880 tied) was still valid when untie was
1881 called.
1882
1883
1884 Unrecognized character %s
1885
1886
1887 (F) The Perl parser has no idea what to do with the
1888 specified character in your Perl script (or eval). Perhaps
1889 you tried to run a compressed script, a binary program, or a
1890 directory as a Perl program.
1891
1892
1893 Unsupported function fork
1894
1895
1896 (F) Your version of executable does not support
1897 forking.
1898
1899
1900 Note that under some systems, like OS/2 ,
1901 there may be different flavors of Perl executables, some of
1902 which may support fork, some not. Try changing the name you
1903 call Perl by to perl_, perl__, and so
1904 on.
1905
1906
1907 Use of ``$$
1908
1909
1910 (D) Perl versions before 5.004 misinterpreted any type
1911 marker followed by ``$'' and a digit. For example, ``$$0''
1912 was incorrectly taken to mean ``${$}0'' instead of
1913 ``${$0}''. This bug is (mostly) fixed in Perl
1914 5.004.
1915
1916
1917 However, the developers of Perl 5.004 could not fix this bug
1918 completely, because at least two widely-used modules depend
1919 on the old meaning of ``$$0'' in a string. So Perl 5.004
1920 still interprets ``$$
1921
1922
1923 Value of %s can be ``0''; test with
1924 ''defined()''
1925
1926
1927 (W) In a conditional expression, you used
1928 HANDLE
1929 each(), or readdir() as a boolean value.
1930 Each of these constructs can return a value of ``0''; that
1931 would make the conditional expression false, which is
1932 probably not what you intended. When using these constructs
1933 in conditional expressions, test their values with the
1934 defined operator.
1935
1936
1937 Variable ``%s'' may be unavailable
1938
1939
1940 (W) An inner (nested) ''anonymous'' subroutine is inside
1941 a ''named'' subroutine, and outside that is another
1942 subroutine; and the anonymous (innermost) subroutine is
1943 referencing a lexical variable defined in the outermost
1944 subroutine. For example:
1945
1946
1947 sub outermost { my $a; sub middle { sub { $a } } }
1948 If the anonymous subroutine is called or referenced (directly or indirectly) from the outermost subroutine, it will share the variable as you would expect. But if the anonymous subroutine is called or referenced when the outermost subroutine is not active, it will see the value of the shared variable as it was before and during the *first* call to the outermost subroutine, which is probably not what you want.
1949
1950
1951 In these circumstances, it is usually best to make the
1952 middle subroutine anonymous, using the sub {}
1953 syntax. Perl has specific support for shared variables in
1954 nested anonymous subroutines; a named subroutine in between
1955 interferes with this feature.
1956
1957
1958 Variable ``%s'' will not stay shared
1959
1960
1961 (W) An inner (nested) ''named'' subroutine is referencing
1962 a lexical variable defined in an outer
1963 subroutine.
1964
1965
1966 When the inner subroutine is called, it will probably see
1967 the value of the outer subroutine's variable as it was
1968 before and during the *first* call to the outer subroutine;
1969 in this case, after the first call to the outer subroutine
1970 is complete, the inner and outer subroutines will no longer
1971 share a common value for the variable. In other words, the
1972 variable will no longer be shared.
1973
1974
1975 Furthermore, if the outer subroutine is anonymous and
1976 references a lexical variable outside itself, then the outer
1977 and inner subroutines will ''never'' share the given
1978 variable.
1979
1980
1981 This problem can usually be solved by making the inner
1982 subroutine anonymous, using the sub {} syntax. When
1983 inner anonymous subs that reference variables in outer
1984 subroutines are called or referenced, they are automatically
1985 rebound to the current values of such
1986 variables.
1987
1988
1989 Warning: something's wrong
1990
1991
1992 (W) You passed ''warn()'' an empty string (the equivalent
1993 of warn ) or you called it with no args
1994 and $_ was empty.
1995
1996
1997 Ill-formed logical name %s in prime_env_iter
1998
1999
2000 (W) A warning peculiar to VMS . A logical
2001 name was encountered when preparing to iterate over
2002 %ENV which violates the syntactic rules governing
2003 logical names. Since it cannot be translated normally, it is
2004 skipped, and will not appear in %ENV. This may be a
2005 benign occurrence, as some software packages might directly
2006 modify logical name tables and introduce nonstandard names,
2007 or it may indicate that a logical name table has been
2008 corrupted.
2009
2010
2 perry 2011 Got an error from !DosAllocMem
1 perry 2012
2013
2014 (P) An error peculiar to OS/2 . Most probably
2015 you're using an obsolete version of Perl, and this should
2016 not happen anyway.
2017
2018
2019 Malformed PERLLIB_PREFIX
2020
2021
2022 (F) An error peculiar to OS/2 .
2023 PERLLIB_PREFIX should be of the
2024 form
2025
2026
2027 prefix1;prefix2
2028 or
2029
2030
2031 prefix1 prefix2
2032 with nonempty prefix1 and prefix2. If prefix1 is indeed a prefix of a builtin library search path, prefix2 is substituted. The error may appear if components are not found, or are too long. See `` PERLLIB_PREFIX '' in ''README .os2''.
2033
2034
2035 PERL_SH_DIR too long
2036
2037
2038 (F) An error peculiar to OS/2 .
2039 PERL_SH_DIR is the directory to find the
2040 sh-shell in. See `` PERL_SH_DIR ''
2041 in ''README .os2''.
2042
2043
2044 Process terminated by SIG%s
2045
2046
2047 (W) This is a standard message issued by OS/2
2048 applications, while *nix applications die in silence. It is
2049 considered a feature of the OS/2 port. One
2050 can easily disable this by appropriate sighandlers, see
2051 ``Signals'' in perlipc. See also ``Process terminated by
2052 SIGTERM/SIGINT '' in ''README
2053 .os2''.
2054 !!BUGS
2055
2056
2057 If you find what you think is a bug, you might check the
2058 headers of recently posted articles in the
2059 comp.lang.perl.misc newsgroup. There may also be information
2060 at http://www.perl.com/perl/, the Perl Home
2061 Page.
2062
2063
2064 If you believe you have an unreported bug, please run the
2065 __perlbug__ program included with your release. Make sure
2066 you trim your bug down to a tiny but sufficient test case.
2067 Your bug report, along with the output of perl -V,
2068 will be sent off to perlbug@perl.com''
2069 ''
2070 !!SEE ALSO
2071
2072
2073 The ''Changes'' file for exhaustive details on what
2074 changed.
2075
2076
2077 The ''INSTALL'' file for how to build
2078 Perl. This file has been significantly updated for 5.004, so
2079 even veteran users should look through it.
2080
2081
2082 The ''README'' file for general
2083 stuff.
2084
2085
2086 The ''Copying'' file for copyright
2087 information.
2088 !!HISTORY
2089
2090
2091 Constructed by Tom Christiansen, grabbing material with
2092 permission from innumerable contributors, with kibitzing by
2093 more than a few Perl porters.
2094
2095
2096 Last update: Wed May 14 11:14:09 EDT
2097 1997
2098 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.