in reply to Re: __DATA__, seek, and tell
in thread __DATA__, seek, and tell

I'm using DATA because I would like to be able to edit the Perl file on disk, and have it reload the changes when I tell it to.

Replies are listed 'Best First'.
Re^3: __DATA__, seek, and tell
by ikegami (Patriarch) on Oct 16, 2007 at 15:51 UTC

    Replacing parts of your programs sounds really ugly and dangerous. I can easily envision problems with global my variable, for example. Seems to me a frest start using exec $^X, $0, @ARGV; would be a much better way of achieving that.

    If you're determined to stay on your course, why now keep the reloadable code in a seperate file and just do that file instead of messing with DATA. Keep in mind that what you are doing with DATA is an undocumented side-effect of the implementation of DATA.

    A reply falls below the community's threshold of quality. You may see it by logging in.