home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / RiscOS / APP / DEVS / PERL / RPC106.ZIP / Rpc106 / Docs / perldelta < prev    next >
Text File  |  1997-11-23  |  56KB  |  1,506 lines

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