Skip Menu |

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

Report information
The Basics
Id: 5425
Status: resolved
Priority: 0/
Queue: IO-String

People
Owner: Nobody in particular
Requestors: cpan.org [...] antibozo.net
Cc:
AdminCc:

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



Subject: paragraph mode is broken -- $eol should be set if $c ne "\n"
Instead of returning paragraphs when $/ = '', IO::String returns pairs of two consecutive lines. This breaks, among other things, reading from an IO::String in Net::LDAP::LDIF. Patch designed to emulate normal behavior for $/ and <STDIN>: --- IO/String.pm.orig Thu Jan 8 07:41:23 2004 +++ IO/String.pm Mon Feb 23 21:13:04 2004 @@ -220,11 +220,14 @@ my $c; while (defined($c = $self->getc)) { if ($c eq "\n") { - $eol++; - } elsif ($eol > 1) { + next if (++$eol >= 3); + } + elsif ($eol > 1) + { $self->ungetc($c); last; } + else { $eol = 0; } $para .= $c; } return $para; # XXX wantarray