Skip to content

Commit

Permalink
Note that DATA filehandle is unavailable during BEGIN {}
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Neil Bowers authored and Chip Salzenberg committed May 15, 1997
1 parent 1615ca7 commit 1d79a27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pod/perldata.pod
Expand Up @@ -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
Expand Down

0 comments on commit 1d79a27

Please sign in to comment.