in reply to Re: __END__ is equivalent to __DATA__ ?
in thread __END__ is equivalent to __DATA__ ?
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.
|
|---|