From: Chip Salzenberg Date: Thu, 15 May 1997 22:15:00 +0000 (+1200) Subject: Note that DATA filehandle is unavailable during BEGIN {} X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a00c1fe511e2428fef6e71b4b7d1feb78dff9aa3;p=p5sagit%2Fp5-mst-13.2.git Note that DATA filehandle is unavailable during BEGIN {} (this is the same change as commit 1d79a27f835368158fa27370bebb63728faf77b2, but as applied) --- diff --git a/pod/perldata.pod b/pod/perldata.pod index 0dbb92a..38d5e93 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -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 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