summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-02-22 04:41:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-02-22 04:41:00 +1200
commitaa6893958c2bfb6fa4ab923c8466c188c65748fd (patch)
tree012b1f5dd2622b8c322606df0fa2de1a7ec582b1 /pod
parentd53f8f1cc3de155a009198bbc7c01e2741aa70ac (diff)
downloadperl-aa6893958c2bfb6fa4ab923c8466c188c65748fd.tar.gz
[inseparable changes from patch from perl5.003_27 to perl5.003_28]
CORE LANGUAGE CHANGES Subject: Don't let C<sub foo;> undefine &foo From: Chip Salzenberg <chip@perl.com> Files: op.c Subject: Make code, doc agree on $ENV{PATH} and `cmd` From: Chip Salzenberg <chip@perl.com> Files: pod/perlsec.pod pp_sys.c Subject: Optimize keys() and values() in void context From: Chip Salzenberg <chip@perl.com> Files: doop.c op.c CORE PORTABILITY Subject: VMS patches post _27 Date: Thu, 20 Feb 1997 01:58:46 -0500 (EST) From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU> Files: MANIFEST dosish.h hv.c lib/ExtUtils/MM_VMS.pm lib/ExtUtils/xsubpp perl.c perlsdio.h pod/perldelta.pod pod/perlvar.pod t/op/closure.t unixish.h vms/Makefile vms/descrip.mms vms/ext/filespec.t vms/genconfig.pl vms/vms.c vms/vmsish.h private-msgid: <01IFMEMPN1IU0057E2@hmivax.humgen.upenn.edu> Subject: Re: OS/2 patch for _27 Date: Thu, 20 Feb 1997 19:24:16 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: INSTALL README.os2 lib/Test/Harness.pm os2/Changes os2/OS2/PrfDB/t/os2_prfdb.t os2/os2.c os2/os2ish.h os2/perl2cmd.pl perl.c pod/perldelta.pod t/TEST t/harness t/op/magic.t Msg-ID: <199702210024.TAA03174@monk.mps.ohio-state.edu> (applied based on p5p patch as commit 833d3f255ed68b969f062cec63d33f853ed9237c) DOCUMENTATION Subject: INSTALL updates since _26 Date: Tue, 18 Feb 1997 16:00:08 -0500 (EST) From: Andy Dougherty <doughera@fractal.phys.lafayette.edu> Files: INSTALL Msg-ID: <Pine.SOL.3.95q.970218155815.2014F-100000@fractal.lafayette.e (applied based on p5p patch as commit a8247d96fd6167a3b920e63aedee5592cd6e29a7) Subject: Document "$$0" change From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod Subject: Don't recommend impossible //o for C<$x =~ $y> From: Chip Salzenberg <chip@perl.com> Files: pod/perlop.pod Subject: Correct doc that claimed that <FH> was never false From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod pod/perlop.pod Subject: Document C<$?> vs. $SIG{CHLD} From: Ulrich Pfeifer <pfeifer@charly.informatik.uni-dortmund.de> Files: pod/perlvar.pod Subject: Add pumpkin.pod From: Chip Salzenberg <chip@perl.com> Files: MANIFEST Porting/pumpkin.pod Subject: Don't say "associat*ve arr*y" From: Chip Salzenberg <chip@perl.com> Files: MANIFEST gv.h hv.c lib/Env.pm lib/overload.pm opcode.pl pod/perl.pod pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod pod/perlguts.pod pod/perlmod.pod pod/perltie.pod pod/perltoc.pod pod/perltrap.pod x2p/a2p.pod OTHER CORE CHANGES Subject: Fix a typo From: Chip Salzenberg <chip@perl.com> Files: pp_sys.c Subject: Fix perl_call_sv(..., G_NOARGS) From: Chip Salzenberg <chip@perl.com> Files: perl.c Subject: Fix SIGSEGV when cloning sub with complex expression From: Chip Salzenberg <chip@perl.com> Files: op.c
Diffstat (limited to 'pod')
-rw-r--r--pod/perl.pod38
-rw-r--r--pod/perldelta.pod84
-rw-r--r--pod/perldiag.pod8
-rw-r--r--pod/perlfunc.pod132
-rw-r--r--pod/perlguts.pod12
-rw-r--r--pod/perlmod.pod18
-rw-r--r--pod/perlop.pod23
-rw-r--r--pod/perlsec.pod25
-rw-r--r--pod/perltie.pod25
-rw-r--r--pod/perltoc.pod62
-rw-r--r--pod/perltrap.pod5
-rw-r--r--pod/perlvar.pod5
12 files changed, 253 insertions, 184 deletions
diff --git a/pod/perl.pod b/pod/perl.pod
index e8522fe89b..302f58b94d 100644
--- a/pod/perl.pod
+++ b/pod/perl.pod
@@ -90,26 +90,28 @@ system management tasks. The language is intended to be practical
(easy to use, efficient, complete) rather than beautiful (tiny,
elegant, minimal).
-Perl combines (in the author's opinion, anyway) some
-of the best features of C, B<sed>, B<awk>, and B<sh>, so people
-familiar with those languages should have little difficulty with it.
-(Language historians will also note some vestiges of B<csh>, Pascal,
-and even BASIC-PLUS.) Expression syntax corresponds quite closely to C
+Perl combines (in the author's opinion, anyway) some of the best
+features of C, B<sed>, B<awk>, and B<sh>, so people familiar with
+those languages should have little difficulty with it. (Language
+historians will also note some vestiges of B<csh>, Pascal, and even
+BASIC-PLUS.) Expression syntax corresponds quite closely to C
expression syntax. Unlike most Unix utilities, Perl does not
arbitrarily limit the size of your data--if you've got the memory,
-Perl can slurp in your whole file as a single string. Recursion is
-of unlimited depth. And the hash tables used by associative arrays
-grow as necessary to prevent degraded performance. Perl uses
-sophisticated pattern matching techniques to scan large amounts of data
-very quickly. Although optimized for scanning text, Perl can also
-deal with binary data, and can make dbm files look like associative
-arrays. Setuid Perl scripts are safer than
-C programs through a dataflow tracing mechanism which prevents many
-stupid security holes. If you have a problem that would ordinarily use
-B<sed> or B<awk> or B<sh>, but it exceeds their capabilities or must
-run a little faster, and you don't want to write the silly thing in C,
-then Perl may be for you. There are also translators to turn your
-B<sed> and B<awk> scripts into Perl scripts.
+Perl can slurp in your whole file as a single string. Recursion is of
+unlimited depth. And the tables used by hashes (previously called
+"associative arrays") grow as necessary to prevent degraded
+performance. Perl uses sophisticated pattern matching techniques to
+scan large amounts of data very quickly. Although optimized for
+scanning text, Perl can also deal with binary data, and can make dbm
+files look like hashes. Setuid Perl scripts are safer than C programs
+through a dataflow tracing mechanism which prevents many stupid
+security holes.
+
+If you have a problem that would ordinarily use B<sed> or B<awk> or
+B<sh>, but it exceeds their capabilities or must run a little faster,
+and you don't want to write the silly thing in C, then Perl may be for
+you. There are also translators to turn your B<sed> and B<awk>
+scripts into Perl scripts.
But wait, there's more...
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index ab5cde38ff..628ca22f27 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -34,6 +34,14 @@ application of opcode masks. The revised Safe module has a new API
and is implemented using the new Opcode module. Please read the new
Opcode and Safe documentation.
+=head2 Fixed Parsing of $$<digit>, &$<digit>, etc.
+
+A bug in previous versions of Perl 5.0 prevented proper parsing of
+numeric special variables as symbolic references. That bug has been
+fixed. As a result, the string "$$0" is no longer equivalent to
+C<$$."0">, but rather to C<${$0}>. To get the old behavior, change
+"$$" followed by a digit to "${$}".
+
=head2 Internal Change: FileHandle Deprecated
Filehandles are now stored internally as type IO::Handle.
@@ -103,10 +111,9 @@ So "%hi" means "short integer in decimal", and "%ho" means
=item keys as an lvalue
As an lvalue, C<keys> allows you to increase the number of hash buckets
-allocated for the given associative array. This can gain you a measure
-of efficiency if you know the hash is going to get big. (This is
-similar to pre-extending an array by assigning a larger number to
-$#array.) If you say
+allocated for the given hash. This can gain you a measure of efficiency if
+you know the hash is going to get big. (This is similar to pre-extending
+an array by assigning a larger number to $#array.) If you say
keys %hash = 200;
@@ -122,7 +129,7 @@ as trying has no effect).
You can now use my() (with or without the parentheses) in the control
expressions of control structures such as:
- while (my $line = <>) {
+ while (defined(my $line = <>)) {
$line = lc $line;
} continue {
print $line;
@@ -331,15 +338,72 @@ possibly for cleaning up.
=back
-=item Efficiency Enhancements
+=head2 Malloc Enhancements
+
+If perl's malloc() is used, you can print memory statistics at runtime
+by running Perl thusly:
+
+ env PERL_DEBUG_MSTATS=2 perl your_script_here
+
+The value of 2 means to print statistics after compilation and on
+exit; with a value of 1, the statistics ares printed only on exit.
+(If you want the statistics at an arbitrary time, you'll need to
+install the optional module Devel::Peek.)
+
+In addition, three new compilation flags are recognized by malloc.c.
+(They have no effect if perl is compiled with system malloc().)
+
+=over
+
+=item -DEMERGENCY_SBRK
+
+If this macro is defined, running out of memory need not be a fatal
+error: a memory pool can allocated by assigning to the special
+variable C<$^M>. See L<"$^M">.
-All hash keys with the same string are only allocated once, so
-even if you have 100 copies of the same hash, the immutable keys
-never have to be re-allocated.
+=item -DPACK_MALLOC
+
+Perl memory allocation is by bucket with sizes close to powers of two.
+Because of these malloc overhead may be big, especially for data of
+size exactly a power of two. If C<PACK_MALLOC> is defined, perl uses
+a slightly different algorithm for small allocations (up to 64 bytes
+long), which makes it possible to have overhead down to 1 byte for
+allocations which are powers of two (and appear quite often).
+
+Expected memory savings (with 8-byte alignment in C<alignbytes>) is
+about 20% for typical Perl usage. Expected slowdown due to additional
+malloc overhead is in fractions of a percent (hard to measure, because
+of the effect of saved memory on speed).
+
+=item -DTWO_POT_OPTIMIZE
+
+Similarly to C<PACK_MALLOC>, this macro improves allocations of data
+with size close to a power of two; but this works for big allocations
+(starting with 16K by default). Such allocations are typical for big
+hashes and special-purpose scripts, especially image processing.
+
+On recent systems, the fact that perl requires 2M from system for 1M
+allocation will not affect speed of execution, since the tail of such
+a chunk is not going to be touched (and thus will not require real
+memory). However, it may result in a premature out-of-memory error.
+So if you will be manipulating very large blocks with sizes close to
+powers of two, it would be wise to define this macro.
+
+Expected saving of memory is 0-100% (100% in applications which
+require most memory in such 2**n chunks); expected slowdown is
+negligible.
+
+=back
+
+=head2 Miscellaneous Efficiency Enhancements
Functions that have an empty prototype and that do nothing but return
a fixed value are now inlined (e.g. C<sub PI () { 3.14159 }>).
+Each unique hash key is only allocated once, no matter how many hashes
+have an entry with that key. So even if you have 100 copies of the
+same hash, the hash keys never have to be re-allocated.
+
=head1 Pragmata
Four new pragmatic modules exist:
@@ -382,7 +446,7 @@ Disable unsafe opcodes, or any named opcodes, when compiling Perl code.
=item use vmsish
Enable VMS-specific language features. Currently, there are three
-VMS-specific feature available: 'status', which makes C<$?> and
+VMS-specific features available: 'status', which makes C<$?> and
C<system> return genuine VMS status values instead of emulating POSIX;
'exit', which makes C<exit> take a genuine VMS status value instead of
assuming that C<exit 1> is an error; and 'time', which makes all times
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index ec300c862b..394ffcbab3 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -267,10 +267,6 @@ shmctl(). In C parlance, the correct sizes are, respectively,
S<sizeof(struct msqid_ds *)>, S<sizeof(struct semid_ds *)>, and
S<sizeof(struct shmid_ds *)>.
-=item Bad associative array
-
-(P) One of the internal hash routines was passed a null HV pointer.
-
=item Bad filehandle: %s
(F) A symbol was passed to something wanting a filehandle, but the symbol
@@ -288,6 +284,10 @@ This message can be quite often seen with DB_File on systems with
C<Berkeley DB> which is left unnoticed if C<DB> uses I<forgiving>
system malloc().
+=item Bad hash
+
+(P) One of the internal hash routines was passed a null HV pointer.
+
=item Bad name after %s::
(F) You started to name a symbol by using a package prefix, and then didn't
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 6825d22e7d..9d21587696 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -622,31 +622,31 @@ their own password:
Of course, typing in your own password to whomever asks you
for it is unwise.
-=item dbmclose ASSOC_ARRAY
+=item dbmclose HASH
[This function has been superseded by the untie() function.]
-Breaks the binding between a DBM file and an associative array.
+Breaks the binding between a DBM file and a hash.
-=item dbmopen ASSOC,DBNAME,MODE
+=item dbmopen HASH,DBNAME,MODE
[This function has been superseded by the tie() function.]
-This binds a dbm(3), ndbm(3), sdbm(3), gdbm(), or Berkeley DB file to an
-associative array. ASSOC is the name of the associative array. (Unlike
-normal open, the first argument is I<NOT> a filehandle, even though it
-looks like one). DBNAME is the name of the database (without the F<.dir>
-or F<.pag> extension if any). If the database does not exist, it is
-created with protection specified by MODE (as modified by the umask()).
-If your system supports only the older DBM functions, you may perform only
-one dbmopen() in your program. In older versions of Perl, if your system
-had neither DBM nor ndbm, calling dbmopen() produced a fatal error; it now
-falls back to sdbm(3).
-
-If you don't have write access to the DBM file, you can only read
-associative array variables, not set them. If you want to test whether
-you can write, either use file tests or try setting a dummy array entry
-inside an eval(), which will trap the error.
+This binds a dbm(3), ndbm(3), sdbm(3), gdbm(), or Berkeley DB file to a
+hash. HASH is the name of the hash. (Unlike normal open, the first
+argument is I<NOT> a filehandle, even though it looks like one). DBNAME
+is the name of the database (without the F<.dir> or F<.pag> extension if
+any). If the database does not exist, it is created with protection
+specified by MODE (as modified by the umask()). If your system supports
+only the older DBM functions, you may perform only one dbmopen() in your
+program. In older versions of Perl, if your system had neither DBM nor
+ndbm, calling dbmopen() produced a fatal error; it now falls back to
+sdbm(3).
+
+If you don't have write access to the DBM file, you can only read hash
+variables, not set them. If you want to test whether you can write,
+either use file tests or try setting a dummy hash entry inside an eval(),
+which will trap the error.
Note that functions such as keys() and values() may return huge array
values when used on large DBM files. You may prefer to use the each()
@@ -677,8 +677,8 @@ a real null string, such as referencing elements of an array. You may
also check to see if arrays or subroutines exist. Use of defined on
predefined variables is not guaranteed to produce intuitive results.
-When used on a hash array element, it tells you whether the value
-is defined, not whether the key exists in the hash. Use exists() for that.
+When used on a hash array element, it tells you whether the value is
+defined, not whether the key exists in the hash. Use exists() for that.
Examples:
@@ -727,14 +727,14 @@ changed, fixed, or broken in a future release of Perl.
=item delete EXPR
-Deletes the specified key(s) and their associated values from a hash
-array. For each key, returns the deleted value associated with that key,
-or the undefined value if there was no such key. Deleting from C<$ENV{}>
-modifies the environment. Deleting from an array tied to a DBM file
+Deletes the specified key(s) and their associated values from a hash.
+For each key, returns the deleted value associated with that key, or
+the undefined value if there was no such key. Deleting from C<$ENV{}>
+modifies the environment. Deleting from a hash tied to a DBM file
deletes the entry from the DBM file. (But deleting from a tie()d hash
doesn't necessarily return anything.)
-The following deletes all the values of an associative array:
+The following deletes all the values of a hash:
foreach $key (keys %HASH) {
delete $HASH{$key};
@@ -854,22 +854,23 @@ Example:
QUICKSTART:
Getopt('f');
-=item each ASSOC_ARRAY
-
-When called in a list context, returns a 2-element array consisting
-of the key and value for the next element of an associative array,
-so that you can iterate over it. When called in a scalar context,
-returns the key for only the next element in the associative array.
-Entries are returned in an apparently random order. When the array is
-entirely read, a null array is returned in list context (which when
-assigned produces a FALSE (0) value), and C<undef> is returned in a
-scalar context. The next call to each() after that will start
-iterating again. The iterator can be reset only by reading all the
-elements from the array. You should not add elements to an array while
-you're iterating over it. There is a single iterator for each
-associative array, shared by all each(), keys(), and values() function
-calls in the program. The following prints out your environment like
-the printenv(1) program, only in a different order:
+=item each HASH
+
+When called in a list context, returns a 2-element array consisting of the
+key and value for the next element of a hash, so that you can iterate over
+it. When called in a scalar context, returns the key for only the next
+element in the hash. Entries are returned in an apparently random order.
+When the hash is entirely read, a null array is returned in list context
+(which when assigned produces a FALSE (0) value), and C<undef> is returned
+in a scalar context. The next call to each() after that will start
+iterating again. There is a single iterator for each hash, shared by all
+each(), keys(), and values() function calls in the program; it can be
+reset by reading all the elements from the hash, or by evaluating C<keys
+HASH> or C<values HASH> in a scalar context. You should not add elements
+to an hash while you're iterating over it.
+
+The following prints out your environment like the printenv(1) program,
+only in a different order:
while (($key,$value) = each %ENV) {
print "$key=$value\n";
@@ -1573,14 +1574,15 @@ Example:
See L<perlfunc/split>.
-=item keys ASSOC_ARRAY
+=item keys HASH
+
+Returns a normal array consisting of all the keys of the named hash. (In
+a scalar context, returns the number of keys.) The keys are returned in
+an apparently random order, but it is the same order as either the
+values() or each() function produces (given that the hash has not been
+modified). As a side effect, it resets HASH's iterator.
-Returns a normal array consisting of all the keys of the named
-associative array. (In a scalar context, returns the number of keys.)
-The keys are returned in an apparently random order, but it is the same
-order as either the values() or each() function produces (given that
-the associative array has not been modified). Here is yet another way
-to print your environment:
+Here is yet another way to print your environment:
@keys = keys %ENV;
@values = values %ENV;
@@ -1594,18 +1596,17 @@ or how about sorted by key:
print $key, '=', $ENV{$key}, "\n";
}
-To sort an array by value, you'll need to use a C<sort{}>
-function. Here's a descending numeric sort of a hash by its values:
+To sort an array by value, you'll need to use a C<sort{}> function.
+Here's a descending numeric sort of a hash by its values:
foreach $key (sort { $hash{$b} <=> $hash{$a} } keys %hash)) {
printf "%4d %s\n", $hash{$key}, $key;
}
As an lvalue C<keys> allows you to increase the number of hash buckets
-allocated for the given associative array. This can gain you a measure
-of efficiency if you know the hash is going to get big. (This is
-similar to pre-extending an array by assigning a larger number to
-$#array.) If you say
+allocated for the given hash. This can gain you a measure of efficiency if
+you know the hash is going to get big. (This is similar to pre-extending
+an array by assigning a larger number to $#array.) If you say
keys %hash = 200;
@@ -2377,7 +2378,7 @@ If the referenced object has been blessed into a package, then that package
name is returned instead. You can think of ref() as a typeof() operator.
if (ref($r) eq "HASH") {
- print "r is a reference to an associative array.\n";
+ print "r is a reference to a hash.\n";
}
if (!ref ($r) {
print "r is not a reference at all.\n";
@@ -2832,8 +2833,8 @@ Examples:
}
@sortedclass = sort byage @class;
- # this sorts the %age associative arrays by value
- # instead of key using an in-line function
+ # this sorts the %age hash by value instead of key
+ # using an in-line function
@eldest = sort { $age{$b} <=> $age{$a} } keys %age;
sub backwards { $b cmp $a; }
@@ -3369,8 +3370,7 @@ use the each() function to iterate over such. Example:
}
untie(%HIST);
-A class implementing an associative array should have the following
-methods:
+A class implementing a hash should have the following methods:
TIEHASH classname, LIST
DESTROY this
@@ -3475,7 +3475,7 @@ subroutine. Examples:
undef $foo;
undef $bar{'blurfl'};
undef @ary;
- undef %assoc;
+ undef %hash;
undef &mysub;
return (wantarray ? () : undef) if $they_blew_it;
@@ -3629,13 +3629,13 @@ to the current time. Example of a "touch" command:
$now = time;
utime $now, $now, @ARGV;
-=item values ASSOC_ARRAY
+=item values HASH
-Returns a normal array consisting of all the values of the named
-associative array. (In a scalar context, returns the number of
-values.) The values are returned in an apparently random order, but it
-is the same order as either the keys() or each() function would produce
-on the same array. See also keys(), each(), and sort().
+Returns a normal array consisting of all the values of the named hash.
+(In a scalar context, returns the number of values.) The values are
+returned in an apparently random order, but it is the same order as either
+the keys() or each() function would produce on the same hash. As a side
+effect, it resets HASH's iterator. See also keys(), each(), and sort().
=item vec EXPR,OFFSET,BITS
diff --git a/pod/perlguts.pod b/pod/perlguts.pod
index 3d16f94f25..77acc98aae 100644
--- a/pod/perlguts.pod
+++ b/pod/perlguts.pod
@@ -504,12 +504,12 @@ C<sv_2mortal> or C<sv_mortalcopy> routines.
=head2 Stashes and Globs
-A stash is a hash table (associative array) that contains all of the
-different objects that are contained within a package. Each key of the
-stash is a symbol name (shared by all the different types of objects
-that have the same name), and each value in the hash table is called a
-GV (for Glob Value). This GV in turn contains references to the various
-objects of that name, including (but not limited to) the following:
+A "stash" is a hash that contains all of the different objects that
+are contained within a package. Each key of the stash is a symbol
+name (shared by all the different types of objects that have the same
+name), and each value in the hash table is a GV (Glob Value). This GV
+in turn contains references to the various objects of that name,
+including (but not limited to) the following:
Scalar Value
Array Value
diff --git a/pod/perlmod.pod b/pod/perlmod.pod
index b7383d23d3..9b649d6425 100644
--- a/pod/perlmod.pod
+++ b/pod/perlmod.pod
@@ -67,15 +67,15 @@ or L<perlref> regarding closures.
=head2 Symbol Tables
-The symbol table for a package happens to be stored in the associative
-array of that name appended with two colons. The main symbol table's
-name is thus C<%main::>, or C<%::> for short. Likewise symbol table for
-the nested package mentioned earlier is named C<%OUTER::INNER::>.
-
-The value in each entry of the associative array is what you are referring
-to when you use the C<*name> typeglob notation. In fact, the following
-have the same effect, though the first is more efficient because it does
-the symbol table lookups at compile time:
+The symbol table for a package happens to be stored in the hash of that
+name with two colons appended. The main symbol table's name is thus
+C<%main::>, or C<%::> for short. Likewise symbol table for the nested
+package mentioned earlier is named C<%OUTER::INNER::>.
+
+The value in each entry of the hash is what you are referring to when you
+use the C<*name> typeglob notation. In fact, the following have the same
+effect, though the first is more efficient because it does the symbol
+table lookups at compile time:
local(*main::foo) = *main::bar; local($main::{'foo'}) =
$main::{'bar'};
diff --git a/pod/perlop.pod b/pod/perlop.pod
index 55108f0328..88a8af0fd4 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -167,9 +167,8 @@ supposed to be searched, substituted, or translated instead of the default
$_. The return value indicates the success of the operation. (If the
right argument is an expression rather than a search pattern,
substitution, or translation, it is interpreted as a search pattern at run
-time. This is less efficient than an explicit search, because the pattern
-must be compiled every time the expression is evaluated--unless you've
-used C</o>.)
+time. This can be is less efficient than an explicit search, because the
+pattern must be compiled every time the expression is evaluated.
Binary "!~" is just like "=~" except the return value is negated in
the logical sense.
@@ -1001,15 +1000,15 @@ always undergo shell expansion as well, see L<perlsec> for
security concerns.)
Evaluating a filehandle in angle brackets yields the next line from
-that file (newline included, so it's never false until end of file, at
-which time an undefined value is returned). Ordinarily you must assign
-that value to a variable, but there is one situation where an automatic
-assignment happens. I<If and ONLY if> the input symbol is the only
-thing inside the conditional of a C<while> loop, the value is
-automatically assigned to the variable C<$_>. The assigned value is
-then tested to see if it is defined. (This may seem like an odd thing
-to you, but you'll use the construct in almost every Perl script you
-write.) Anyway, the following lines are equivalent to each other:
+that file (newline, if any, included), or C<undef> at end of file.
+Ordinarily you must assign that value to a variable, but there is one
+situation where an automatic assignment happens. I<If and ONLY if> the
+input symbol is the only thing inside the conditional of a C<while> or
+C<for(;;)> loop, the value is automatically assigned to the variable
+C<$_>. The assigned value is then tested to see if it is defined.
+(This may seem like an odd thing to you, but you'll use the construct
+in almost every Perl script you write.) Anyway, the following lines
+are equivalent to each other:
while (defined($_ = <STDIN>)) { print; }
while (<STDIN>) { print; }
diff --git a/pod/perlsec.pod b/pod/perlsec.pod
index 2324b8a373..5961200f4d 100644
--- a/pod/perlsec.pod
+++ b/pod/perlsec.pod
@@ -20,11 +20,10 @@ mode explicitly by using the B<-T> command line flag. This flag is
I<strongly> suggested for server programs and any program run on behalf of
someone else, such as a CGI script.
-While in this mode, Perl takes special precautions called I<taint
-checks> to prevent both obvious and subtle traps. Some of these checks
-are reasonably simple, such as verifying that path directories aren't
-writable by others; careful programmers have always used checks like
-these. Other checks, however, are best supported by the language itself,
+While in this mode, Perl takes special precautions called I<taint checks> to
+prevent both obvious and subtle traps. Some of these checks are reasonably
+simple, such as not blindly using the PATH inherited from one's parent
+process. Other checks, however, are best supported by the language itself,
and it is these checks especially that contribute to making a setuid Perl
program more secure than the corresponding C program.
@@ -145,15 +144,13 @@ block. See L<perllocale/SECURITY> for further discussion and examples.
=head2 Cleaning Up Your Path
For "Insecure C<$ENV{PATH}>" messages, you need to set C<$ENV{'PATH'}> to a
-known value, and each directory in the path must be non-writable by others
-than its owner and group. You may be surprised to get this message even
-if the pathname to your executable is fully qualified. This is I<not>
-generated because you didn't supply a full path to the program; instead,
-it's generated because you never set your PATH environment variable, or
-you didn't set it to something that was safe. Because Perl can't
-guarantee that the executable in question isn't itself going to turn
-around and execute some other program that is dependent on your PATH, it
-makes sure you set the PATH.
+known value. You may be surprised to get this message even if the pathname
+to your executable is fully qualified. This is I<not> generated because you
+didn't supply a full path to the program; instead, it's generated because
+you never set your PATH environment variable. Because Perl can't guarantee
+that the executable in question isn't itself going to turn around and
+execute some other program that is dependent on your PATH, it makes sure you
+set the PATH.
It's also possible to get into trouble with other operations that don't
care whether they use tainted values. Make judicious use of the file
diff --git a/pod/perltie.pod b/pod/perltie.pod
index 13135c4ad5..dfc6894172 100644
--- a/pod/perltie.pod
+++ b/pod/perltie.pod
@@ -293,19 +293,18 @@ the following output demonstrates:
=head2 Tying Hashes
-As the first Perl data type to be tied (see dbmopen()), associative arrays
-have the most complete and useful tie() implementation. A class
-implementing a tied associative array should define the following
-methods: TIEHASH is the constructor. FETCH and STORE access the key and
-value pairs. EXISTS reports whether a key is present in the hash, and
-DELETE deletes one. CLEAR empties the hash by deleting all the key and
-value pairs. FIRSTKEY and NEXTKEY implement the keys() and each()
-functions to iterate over all the keys. And DESTROY is called when the
-tied variable is garbage collected.
-
-If this seems like a lot, then feel free to inherit from
-merely the standard Tie::Hash module for most of your methods, redefining only
-the interesting ones. See L<Tie::Hash> for details.
+As the first Perl data type to be tied (see dbmopen()), hashes have the
+most complete and useful tie() implementation. A class implementing a
+tied hash should define the following methods: TIEHASH is the constructor.
+FETCH and STORE access the key and value pairs. EXISTS reports whether a
+key is present in the hash, and DELETE deletes one. CLEAR empties the
+hash by deleting all the key and value pairs. FIRSTKEY and NEXTKEY
+implement the keys() and each() functions to iterate over all the keys.
+And DESTROY is called when the tied variable is garbage collected.
+
+If this seems like a lot, then feel free to inherit from merely the
+standard Tie::Hash module for most of your methods, redefining only the
+interesting ones. See L<Tie::Hash> for details.
Remember that Perl distinguishes between a key not existing in the hash,
and the key existing in the hash but having a corresponding value of
diff --git a/pod/perltoc.pod b/pod/perltoc.pod
index 224ad5e863..992cd2c3f5 100644
--- a/pod/perltoc.pod
+++ b/pod/perltoc.pod
@@ -54,6 +54,8 @@ HOME, LOGDIR, PATH, PERL5LIB, PERL5DB, PERL_DESTRUCT_LEVEL, PERLLIB
=item New Opcode Module and Revised Safe Module
+=item Fixed Parsing of $$<digit>, &$<digit>, etc.
+
=item Internal Change: FileHandle Deprecated
=item Internal Change: PerlIO internal IO abstraction interface
@@ -76,8 +78,13 @@ isa(CLASS), can(METHOD), VERSION( [NEED] )
=item TIEHANDLE Now Supported
-TIEHANDLE classname, LIST, PRINT this, LIST, READLINE this, DESTROY this,
-Efficiency Enhancements
+TIEHANDLE classname, LIST, PRINT this, LIST, READLINE this, DESTROY this
+
+=item Malloc Enhancements
+
+-DEMERGENCY_SBRK, -DPACK_MALLOC, -DTWO_POT_OPTIMIZE
+
+=item Miscellaneous Efficiency Enhancements
=back
@@ -346,11 +353,11 @@ binmode FILEHANDLE, bless REF,CLASSNAME, bless REF, caller EXPR, caller,
chdir EXPR, chmod LIST, chomp VARIABLE, chomp LIST, chomp, chop VARIABLE,
chop LIST, chop, chown LIST, chr NUMBER, chr, chroot FILENAME, chroot,
close FILEHANDLE, closedir DIRHANDLE, connect SOCKET,NAME, continue BLOCK,
-cos EXPR, crypt PLAINTEXT,SALT, dbmclose ASSOC_ARRAY, dbmopen
-ASSOC,DBNAME,MODE, defined EXPR, defined, delete EXPR, die LIST, do BLOCK,
-do SUBROUTINE(LIST), do EXPR, dump LABEL, each ASSOC_ARRAY, eof FILEHANDLE,
-eof (), eof, eval EXPR, eval BLOCK, exec LIST, exists EXPR, exit EXPR, exp
-EXPR, exp, fcntl FILEHANDLE,FUNCTION,SCALAR, fileno FILEHANDLE, flock
+cos EXPR, crypt PLAINTEXT,SALT, dbmclose HASH, dbmopen HASH,DBNAME,MODE,
+defined EXPR, defined, delete EXPR, die LIST, do BLOCK, do
+SUBROUTINE(LIST), do EXPR, dump LABEL, each HASH, eof FILEHANDLE, eof (),
+eof, eval EXPR, eval BLOCK, exec LIST, exists EXPR, exit EXPR, exp EXPR,
+exp, fcntl FILEHANDLE,FUNCTION,SCALAR, fileno FILEHANDLE, flock
FILEHANDLE,OPERATION, fork, format, formline PICTURE, LIST, getc
FILEHANDLE, getc, getlogin, getpeername SOCKET, getpgrp PID, getppid,
getpriority WHICH,WHO, getpwnam NAME, getgrnam NAME, gethostbyname NAME,
@@ -364,24 +371,24 @@ endprotoent, endservent, getsockname SOCKET, getsockopt
SOCKET,LEVEL,OPTNAME, glob EXPR, glob, gmtime EXPR, goto LABEL, goto EXPR,
goto &NAME, grep BLOCK LIST, grep EXPR,LIST, hex EXPR, hex, import, index
STR,SUBSTR,POSITION, index STR,SUBSTR, int EXPR, int, ioctl
-FILEHANDLE,FUNCTION,SCALAR, join EXPR,LIST, keys ASSOC_ARRAY, kill LIST,
-last LABEL, last, lc EXPR, lc, lcfirst EXPR, lcfirst, length EXPR, length,
-link OLDFILE,NEWFILE, listen SOCKET,QUEUESIZE, local EXPR, localtime EXPR,
-log EXPR, log, lstat FILEHANDLE, lstat EXPR, lstat, m//, map BLOCK LIST,
-map EXPR,LIST, mkdir FILENAME,MODE, msgctl ID,CMD,ARG, msgget KEY,FLAGS,
-msgsnd ID,MSG,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, my EXPR, next LABEL,
-next, no Module LIST, oct EXPR, oct, open FILEHANDLE,EXPR, open FILEHANDLE,
-opendir DIRHANDLE,EXPR, ord EXPR, ord, pack TEMPLATE,LIST, package
-NAMESPACE, pipe READHANDLE,WRITEHANDLE, pop ARRAY, pop, pos SCALAR, pos,
-print FILEHANDLE LIST, print LIST, print, printf FILEHANDLE FORMAT, LIST,
-printf FORMAT, LIST, prototype FUNCTION, push ARRAY,LIST, q/STRING/,
-qq/STRING/, qx/STRING/, qw/STRING/, quotemeta EXPR, quotemeta, rand EXPR,
-rand, read FILEHANDLE,SCALAR,LENGTH,OFFSET, read FILEHANDLE,SCALAR,LENGTH,
-readdir DIRHANDLE, readlink EXPR, readlink, recv SOCKET,SCALAR,LEN,FLAGS,
-redo LABEL, redo, ref EXPR, ref, rename OLDNAME,NEWNAME, require EXPR,
-require, reset EXPR, reset, return LIST, reverse LIST, rewinddir DIRHANDLE,
-rindex STR,SUBSTR,POSITION, rindex STR,SUBSTR, rmdir FILENAME, rmdir, s///,
-scalar EXPR, seek FILEHANDLE,POSITION,WHENCE, seekdir DIRHANDLE,POS, select
+FILEHANDLE,FUNCTION,SCALAR, join EXPR,LIST, keys HASH, kill LIST, last
+LABEL, last, lc EXPR, lc, lcfirst EXPR, lcfirst, length EXPR, length, link
+OLDFILE,NEWFILE, listen SOCKET,QUEUESIZE, local EXPR, localtime EXPR, log
+EXPR, log, lstat FILEHANDLE, lstat EXPR, lstat, m//, map BLOCK LIST, map
+EXPR,LIST, mkdir FILENAME,MODE, msgctl ID,CMD,ARG, msgget KEY,FLAGS, msgsnd
+ID,MSG,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, my EXPR, next LABEL, next, no
+Module LIST, oct EXPR, oct, open FILEHANDLE,EXPR, open FILEHANDLE, opendir
+DIRHANDLE,EXPR, ord EXPR, ord, pack TEMPLATE,LIST, package NAMESPACE, pipe
+READHANDLE,WRITEHANDLE, pop ARRAY, pop, pos SCALAR, pos, print FILEHANDLE
+LIST, print LIST, print, printf FILEHANDLE FORMAT, LIST, printf FORMAT,
+LIST, prototype FUNCTION, push ARRAY,LIST, q/STRING/, qq/STRING/,
+qx/STRING/, qw/STRING/, quotemeta EXPR, quotemeta, rand EXPR, rand, read
+FILEHANDLE,SCALAR,LENGTH,OFFSET, read FILEHANDLE,SCALAR,LENGTH, readdir
+DIRHANDLE, readlink EXPR, readlink, recv SOCKET,SCALAR,LEN,FLAGS, redo
+LABEL, redo, ref EXPR, ref, rename OLDNAME,NEWNAME, require EXPR, require,
+reset EXPR, reset, return LIST, reverse LIST, rewinddir DIRHANDLE, rindex
+STR,SUBSTR,POSITION, rindex STR,SUBSTR, rmdir FILENAME, rmdir, s///, scalar
+EXPR, seek FILEHANDLE,POSITION,WHENCE, seekdir DIRHANDLE,POS, select
FILEHANDLE, select, select RBITS,WBITS,EBITS,TIMEOUT, semctl
ID,SEMNUM,CMD,ARG, semget KEY,NSEMS,FLAGS, semop KEY,OPSTRING, send
SOCKET,MSG,FLAGS,TO, send SOCKET,MSG,FLAGS, setpgrp PID,PGRP, setpriority
@@ -404,9 +411,8 @@ VARIABLE, time, times, tr///, truncate FILEHANDLE,LENGTH, truncate
EXPR,LENGTH, uc EXPR, uc, ucfirst EXPR, ucfirst, umask EXPR, umask, undef
EXPR, undef, unlink LIST, unlink, unpack TEMPLATE,EXPR, untie VARIABLE,
unshift ARRAY,LIST, use Module LIST, use Module, use Module VERSION LIST,
-use VERSION, utime LIST, values ASSOC_ARRAY, vec EXPR,OFFSET,BITS, wait,
-waitpid PID,FLAGS, wantarray, warn LIST, write FILEHANDLE, write EXPR,
-write, y///
+use VERSION, utime LIST, values HASH, vec EXPR,OFFSET,BITS, wait, waitpid
+PID,FLAGS, wantarray, warn LIST, write FILEHANDLE, write EXPR, write, y///
=back
diff --git a/pod/perltrap.pod b/pod/perltrap.pod
index 4b56dd23d8..05cb02b47b 100644
--- a/pod/perltrap.pod
+++ b/pod/perltrap.pod
@@ -47,8 +47,7 @@ You have to decide whether your array has numeric or string indices.
=item *
-Associative array values do not spring into existence upon mere
-reference.
+Hash values do not spring into existence upon mere reference.
=item *
@@ -795,7 +794,7 @@ The behavior is slightly different for:
=item * (Variable Suicide)
Variable suicide behavior is more consistent under Perl 5.
-Perl5 exhibits the same behavior for associative arrays and scalars,
+Perl5 exhibits the same behavior for hashes and scalars,
that perl4 exhibits for only scalars.
$aGlobal{ "aKey" } = "global value";
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index 23c110d34e..d072d25df9 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -404,11 +404,14 @@ C<$? & 255> gives which signal, if any, the process died from, and
whether there was a core dump. (Mnemonic: similar to B<sh> and
B<ksh>.)
+Note that if you have installed a signal handler for C<SIGCHLD>, the
+value of C<$?> will usually be wrong outside that handler.
+
Inside an C<END> subroutine C<$?> contains the value that is going to be
given to C<exit()>. You can modify C<$?> in an C<END> subroutine to
change the exit status of the script.
-Under VMS, the pragma C<use vmsish 'status'> make C<$?> reflect the
+Under VMS, the pragma C<use vmsish 'status'> makes C<$?> reflect the
actual VMS exit status, instead of the default emulation of POSIX
status.