in reply to Do I need/want to close __DATA__?

Warn tells you not only the origin of the exception but also the the coordinates of the input you are reading.

Closing DATA might help, but I'm not sure about side effects, because it's the handle from which the compiler read the source code.

(If you seek DATA to 0 you can read your source again)

Furthermore does every file have its own DATA section, so I'd expect this to be gone if it happens in a module. Hm ... OTOH is possible to deduce the file from the first coordinates.

Anyway, I wouldn't care much about this, because a module shouldn't throw warnings in normal conditions or risk confusing the user anyway.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Do I need/want to close __DATA__?
by Anonymous Monk on Apr 14, 2020 at 01:59 UTC

    Closing DATA might help, but I'm not sure about side effects, because it's the handle from which the compiler read the source code.

    Come on now