This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #88486] IO::File does not always export SEEK*
authorFather Chrysostomos <sprout@cpan.org>
Thu, 14 Apr 2011 13:19:07 +0000 (06:19 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 14 Apr 2011 13:19:07 +0000 (06:19 -0700)
commit221e5dbc861edab87d502b2e8d85f5310d0fd1e4
treed8a08d9dc494628f169a2665358c88b227092ec8
parent6e925ecb7bdbde03e6b1c74f119c1d7cc612cd00
[perl #88486] IO::File does not always export SEEK*

Commit d963bf0 made perl set @IO::File::ISA automagically.

Commit 15e6cdd made filehandle methods load IO::File automagically.

Commit efc5c7c attempted to solve the problem that having IO::Handle
loaded causes IO::File to be bypassed, rendering 15e6cdd only
semi-effective (see [perl #87940]), by requiring IO::File inside
IO::Handle.

That commit ended up breaking several CPAN modules, because IO::File
adds @IO::Seekable::EXPORT to its own exports.

If IO::Seekable is loaded first (before IO::File), before setting up
its @EXPORT it loads IO::Handle, which loads IO::File, which tries to
load IO::Seekable, which is in %INC already, and which is hence wait-
ing for IO::File to load before it sets its own @EXPORT. So IO::File
sees @IO::Seekable::EXPORT empty.

Hence, every piece of code that tries to import SEEK_END from IO::File
will simply not get it if IO::Seekable is already loaded (explicitly
or, e.g., by File::Temp).

This commit hopefully fixes the breakage and the problem that efc5c7c
attempted to fix by loading IO::File only inside IO::Handle::new (the
only method that IO::File overrides).
MANIFEST
META.yml
dist/IO/lib/IO/Handle.pm
dist/IO/t/io_file_export.t [new file with mode: 0644]