7.12.3. Discussion
The _ _DATA_ _ and _ _END_ _
symbols tell the Perl compiler there's nothing more for it to do in
the current file. They represent the logical end for code in a module
or a program before the physical end-of-file.
Text after _ _DATA_ _ or _ _END_
_ can be read through the per-package
DATA filehandle. For example, take the
hypothetical module Primes. Text after _ _DATA_ _
in Primes.pm can be read from the
Primes::DATA filehandle.
_ _END_ _ behaves as a synonym for _
_DATA_ _ in the main package. Any text occurring after an
_ _END_ _ token in a module is completely
inaccessible.
This lets you write self-contained programs instead of keeping data
in separate files. Often this is used for documentation. Sometimes
it's configuration data or old test data that the program was
originally developed with, left lying about should it ever be needed
again.