Subject: | exported seek flags not defined in File::Temp |
SEEK_SET, SEEK_END and SEEK_CUR are exported by File::Temp, but not
imported from anywhere.
IO::Seekable would normally export them by default, but "use base"
doesn't do any imports from the modules it loads.
Please find attached a patch file which includes tests and a suggested fix.
When t is patched and lib is not, I see:
PERL_DL_NONLAZY=1 /usr/bin/perl5.8.8 "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/mktemp......ok
t/object......ok
t/posix.......ok
t/security....ok
t/seekable....ok 1/10
t/seekable....NOK 8# Failed test 'SEEK_SET defined by File::Temp'
# in t/seekable.t at line 34.
# Undefined subroutine &File::Temp::SEEK_SET called at t/seekable.t line 34.
# Failed test 'SEEK_END defined by File::Temp'
# in t/seekable.t at line 35.
# Undefined subroutine &File::Temp::SEEK_END called at t/seekable.t line 35.
t/seekable....NOK 9
# Failed test 'SEEK_CUR defined by File::Temp'
# in t/seekable.t at line 36.
# Undefined subroutine &File::Temp::SEEK_CUR called at t/seekable.t line 36.
# Looks like you failed 3 tests of 10.
t/seekable....dubious
Test returned status 3 (wstat 768, 0x300)
DIED. FAILED tests 8-10
Failed 3/10 tests, 70.00% okay
t/tempfile....ok
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/seekable.t 3 768 10 3 30.00% 8-10
Failed 1/6 test scripts, 83.33% okay. 3/87 subtests failed, 96.55% okay.
make: *** [test_dynamic] Error 255
Subject: | File-Temp.patch |
Index: Temp.pm
===================================================================
--- Temp.pm (.../tags/cpan-0.17) (revision 3404)
+++ Temp.pm (.../trunk) (revision 3404)
@@ -154,6 +154,7 @@
require Symbol if $] < 5.006;
### For the OO interface
+use IO::Seekable; # base won't import symbols
use base qw/ IO::Handle IO::Seekable /;
use overload '""' => "STRINGIFY";
Index: t/seekable.t
===================================================================
--- t/seekable.t (.../tags/cpan-0.17) (revision 3404)
+++ t/seekable.t (.../trunk) (revision 3404)
@@ -6,7 +6,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
-use Test::More tests => 7;
+use Test::More tests => 10;
BEGIN { use_ok('File::Temp') };
#########################
@@ -30,3 +30,7 @@
$c = scalar @File::Temp::EXPORT;
$l = join ' ', @File::Temp::EXPORT;
ok( $c == 9, "really exporting $c: $l" );
+
+ok(defined eval { SEEK_SET() }, 'SEEK_SET defined by File::Temp') or diag $@;
+ok(defined eval { SEEK_END() }, 'SEEK_END defined by File::Temp') or diag $@;
+ok(defined eval { SEEK_CUR() }, 'SEEK_CUR defined by File::Temp') or diag $@;