diff options
author | Neil Bowers <neilb@cre.canon.co.uk> | 1997-05-12 13:27:43 +0100 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-05-16 10:15:00 +1200 |
commit | 1d79a27f835368158fa27370bebb63728faf77b2 (patch) | |
tree | 75ae3fef1d816cf12effcec8e7bea12b93461a5a | |
parent | 1615ca71795d97403e49ca42cacc39b5dbdeeb5e (diff) | |
download | perl-1d79a27f835368158fa27370bebb63728faf77b2.tar.gz |
Note that DATA filehandle is unavailable during BEGIN {}
Subject: DOC PATCH: restriction on DATA filehandle?
This is a very minor patch to add in a clarification on the use of DATA
within a BEGIN block. Thanks to Chip for confirming this.
p5p-msgid: 199705121227.NAA29718@tardis.cre.canon.co.uk
-rw-r--r-- | pod/perldata.pod | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pod/perldata.pod b/pod/perldata.pod index 0dbb92afa5..e55f75a7bc 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<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 hasn't 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 |