in reply to Loading module data
One reason a BEGIN block "doesn't do the job" (probably among several reasons) is described in perldata:
Note that you cannot read from the DATA filehandle in a BEGIN block: the BEGIN block is executed as soon as it is seen (during compilation), at which point the corresponding __DATA__ (or __END__) token has not yet been seen.
In SelfLoader, you can read about how to use the DATA filehandle in packages other than package main.
Dave
|
|---|