Skip Menu |

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

Report information
The Basics
Id: 14674
Status: new
Priority: 0/
Queue: IO-stringy

People
Owner: Nobody in particular
Requestors: cpan [...] kevin.lebleu.info
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.110
Fixed in: (no value)



Subject: format_write and I/O operator write don't work
Using perl's formatted output functions with a file handle such as IO::Lines does not work. When using the I/O operator write, a warning about writing to an unopened filehandle is output. When using the OO syntax, no errors or warnings are produced. In both cases, the output never makes it into the array. Please see the attached code that reproduces the bug, and email me if you have any questions. Distribution name and version: IO-stringy-2.110 Perl version: v5.8.6 OS: Cygwin 1.5.12
#!/usr/bin/perl use Data::Dumper; use IO::Lines; use strict; use warnings; # Setup my $foo = "Written"; format FOO = @|||||||||||||||||| $foo . # Demonstrate code works with STDOUT print STDOUT "Written using STDOUT:\n"; select(STDOUT); print "Printed\n"; $~ = "FOO"; write; print "OO syntax written:\n"; STDOUT->format_name( "FOO"); STDOUT->format_write; # Fails with IO::Lines print STDOUT "Written using IO::Lines:\n"; my @foo; my $fh = new IO::Lines \@foo; select($fh); print "Printed\n"; $~ = "FOO"; write; print "OO syntax written:\n"; $fh->format_name( "FOO"); $fh->format_write; print STDOUT Dumper(\@foo);