problems with reading __DATA__ from current packageby perlguy (Deacon)
|on Jul 16, 2003 at 16:16 UTC||Need Help??|
perlguy has asked for the
wisdom of the Perl Monks concerning the following question:
Having used __DATA__ at the bottom of scripts for a while, I'm a bit frustrated. Instead of reading the <DATA> filehandle in the main:: package, I am wanting to read it in the current package (in this case package States, but I'm struggling with having it read even a single line of __DATA__.
While searching for information on this topic, I often came across code snipplets that read from this special filehandle in other packages. I'm not planning on changing the data anytime soon, so I'd rather just read it from the bottom of my object declaration.
Here is what I have so far:
I'm using v5.8.0 on Solaris 9. The output is the following (printed from the constructor, only for debugging reasons):