Other Literal Tokens
You should consider any identifier that both begins and ends with
a double underscore to be reserved for special syntactic use by
Perl. Two such special literals are _ _LINE_ _ and
_ _FILE_ _, which represent the
current line number and filename at that point in your program. They
may only be used as separate tokens; they will not be interpolated
into strings. Likewise, _ _PACKAGE_ _ is the name of the package the current code is being
compiled into. The token _ _END_ _ (or, alternatively, a Control-D or Control-Z
character) may be used to indicate the logical end of the script
before the real end-of-file. Any following text is ignored but may
be read via the DATA
filehandle.
The _ _DATA_ _ token
functions similarly to the _ _END_ _ token, but it opens the DATA filehandle within the current
package’s namespace, so files you require can each have their own DATA filehandles open simultaneously. For
more information, see DATA in Chapter 25.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access