applied patch, with indentation tweaks
[p5sagit/p5-mst-13.2.git] / pod / perldata.pod
index 2a43319..dc2975a 100644 (file)
@@ -190,13 +190,13 @@ intervening values.  Lengthening an array that was previously shortened
 I<NO LONGER> recovers the values that were in those elements.  (It used to
 in Perl 4, but we had to break this to make sure destructors were
 called when expected.)  You can also gain some measure of efficiency by
-preextending an array that is going to get big.  (You can also extend
+pre-extending an array that is going to get big.  (You can also extend
 an array by assigning to an element that is off the end of the array.)
 You can truncate an array down to nothing by assigning the null list ()
 to it.  The following are equivalent:
 
     @whatever = ();
-    $#whatever = $[ - 1;
+    $#whatever = -1;
 
 If you evaluate a named array in a scalar context, it returns the length of
 the array.  (Note that this is not true of lists, which return the
@@ -296,7 +296,10 @@ ignored, but may be read via a DATA filehandle: main::DATA for __END__,
 or PACKNAME::DATA (where PACKNAME is the current package) for __DATA__.
 The two control characters ^D and ^Z are synonyms for __END__ (or
 __DATA__ in a module).  See L<SelfLoader> for more description of
-__DATA__, and an example of its use.
+__DATA__, and an example of its use.  Note that you cannot read from the
+DATA filehandle in a BEGIN block: the BEGIN block is executed as soon as
+it is seen (during compilation), at which point the corresponding
+__DATA__ (or __END__) token has not yet been seen.
 
 A word that has no other interpretation in the grammar will
 be treated as if it were a quoted string.  These are known as