in reply to Re: __DATA__ only one time
in thread __DATA__ only one time

Please also close DATA at the same time so that you aren't wasting one of my few available file handles by keeping one open in your module that you will never use again.

Also note that you can't access DATA inside of a BEGIN block because the compiler hasn't seen the __DATA__ token yet and so doesn't know what offset to let you start reading from and so doesn't make a DATA handle available yet.

my $data; { local $/; $data = <DATA>; close DATA; }

You might be able to turn that block into an INIT or a CHECK block, but I've never had a need for such so I won't try to make a recommendation based on ignorance.

                - tye