in reply to Using __DATA__ from a package
package Test; sub run { while(<DATA>) { print "$_\n"; } } 1; __DATA__ 1
I made two changes to your code. First, the file handle is always DATA, not PackageName::DATA. Second, I made the package return true, so that you can use it.
If you want to see some real-world examples, then check out these tests (and the modules under t/lib that they use) or Number::Phone::UK::Data
|
|---|