Skip Menu |

This queue is for tickets about the File-Temp CPAN distribution.

Report information
The Basics
Id: 22052
Status: resolved
Priority: 0/
Queue: File-Temp

People
Owner: Nobody in particular
Requestors: matt.lawrence [...] virgin.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.17
Fixed in: 0.18



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 $@;
Just noticed that this was fixed in versiom 0.18
Just noticed that this was fixed in version 0.18