Text after __DATA__ in Primes.pm can be read from the Primes::DATA filehandle.Ahh, too bad I didn't get to review that book... I could have marked that sentence as a technical error. As perldata clearly states:
So, what matters is not the name of the file, but rather the "current package" at the point just before the __DATA__ token. I'm surprised Nat and Tom made such a straightforward mistake. (I've just submitted this as an errata for the book, so hopefully future books will get it right.)Text after __DATA__ but may be read via the filehandle "PACK- NAME::DATA", where "PACKNAME" is the package that was current w +hen the __DATA__ token was encountered.
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to •Re^2: __END__ is equivalent to __DATA__ ?
by merlyn
in thread __END__ is equivalent to __DATA__ ?
by johnnywang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |