Skip Menu |
 

This queue is for tickets about the IO-Tee CPAN distribution.

Report information
The Basics
Id: 4953
Status: new
Priority: 0/
Queue: IO-Tee

People
Owner: Nobody in particular
Requestors: kconnor [...] proofpoint.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.64
Fixed in: (no value)



Subject: IO::Tee incompatibe with format/write
Download (untitled) / with headers
text/plain 378b
see attached format.t. here's the output: 1..4 ok 1 write() on unopened filehandle GEN1 at format.t line 48. not ok 2 # Failed test (format.t at line 51) ok 3 Undefined format "Symbol::GEN5" called at format.t line 34. # Looks like you planned 4 tests but only ran 3. # Looks like your test died just after 3. Attempt to free unreferenced scalar during global destruction.
Download format.t
text/x-perl 1018b
#!/usr/bin/perl -w use Test::More (tests => 4); use IO::Tee; use IO::File; format MYFORMAT = @<<<<<<<<<<<<<<<<<< $<, . test_using_globals(new IO::File('>teebug1.out')); unlink 'teebug1.out'; #this generates a write() on unopened filehandle GEN1 error test_using_globals(new IO::Tee(">teebug1.out", ">teebug2.out")); unlink 'teebug1.out'; unlink 'teebug2.out'; test(new IO::File('>teebug1.out')); unlink 'teebug1.out'; #this one causes Undefined format "Symbol::GEN5" called test(new IO::Tee(">teebug1.out", ">teebug2.out")); unlink 'teebug1.out'; unlink 'teebug2.out'; sub test { my $io = shift; $io->format_name('MYFORMAT'); select $io; write; my $filecontents = `cat teebug1.out`; ok($filecontents =~ /\s+/); } sub test_using_globals { my $io = shift; $io->format_name('MYFORMAT'); select $io; $~ = 'MYFORMAT'; write; my $filecontents = `cat teebug1.out`; ok($filecontents =~ /\s+/); unlink 'teebug2.out'; }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.