Skip Menu |

This queue is for tickets about the HTTP-Request-AsCGI CPAN distribution.

Report information
The Basics
Id: 18075
Status: resolved
Priority: 0/
Queue: HTTP-Request-AsCGI

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

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



Subject: needlessly unfriendly towards perl 5.6
5.6 doesn't have: * 3-arg open with <& &> etc. * as much flexibility with duping from fh vs. fileno The attached patch makes tests pass again.
Subject: http-request-ascgi-561.patch
--- lib/HTTP/Request/AsCGI.pm.orig 2006-01-20 12:37:38.000000000 -0500 +++ lib/HTTP/Request/AsCGI.pm 2006-03-09 08:53:15.000000000 -0500 @@ -92,20 +92,20 @@ or croak("Can't seek stdin handle: $!"); } - open( $self->{restore}->{stdin}, '<&', STDIN->fileno ) + open( $self->{restore}->{stdin}, '<&'. STDIN->fileno ) or croak("Can't dup stdin: $!"); - open( STDIN, '<&=', $self->stdin->fileno ) + open( STDIN, '<&='. $self->stdin->fileno ) or croak("Can't open stdin: $!"); binmode( STDIN ); if ( $self->stdout ) { - open( $self->{restore}->{stdout}, '>&', STDOUT->fileno ) + open( $self->{restore}->{stdout}, '>&'. STDOUT->fileno ) or croak("Can't dup stdout: $!"); - open( STDOUT, '>&=', $self->stdout->fileno ) + open( STDOUT, '>&='. $self->stdout->fileno ) or croak("Can't open stdout: $!"); binmode( $self->stdout ); @@ -114,10 +114,10 @@ if ( $self->stderr ) { - open( $self->{restore}->{stderr}, '>&', STDERR->fileno ) + open( $self->{restore}->{stderr}, '>&'. STDERR->fileno ) or croak("Can't dup stderr: $!"); - open( STDERR, '>&=', $self->stderr->fileno ) + open( STDERR, '>&='. $self->stderr->fileno ) or croak("Can't open stderr: $!"); binmode( $self->stderr ); @@ -227,7 +227,7 @@ %ENV = %{ $self->{restore}->{enviroment} }; } - open( STDIN, '<&', $self->{restore}->{stdin} ) + open( STDIN, '<&'. fileno($self->{restore}->{stdin}) ) or croak("Can't restore stdin: $!"); sysseek( $self->stdin, 0, SEEK_SET ) @@ -238,7 +238,7 @@ STDOUT->flush or croak("Can't flush stdout: $!"); - open( STDOUT, '>&', $self->{restore}->{stdout} ) + open( STDOUT, '>&'. fileno($self->{restore}->{stdout}) ) or croak("Can't restore stdout: $!"); sysseek( $self->stdout, 0, SEEK_SET ) @@ -250,7 +250,7 @@ STDERR->flush or croak("Can't flush stderr: $!"); - open( STDERR, '>&', $self->{restore}->{stderr} ) + open( STDERR, '>&'. fileno($self->{restore}->{stderr}) ) or croak("Can't restore stderr: $!"); sysseek( $self->stderr, 0, SEEK_SET )
Subject: needlessly unfriendly towards perl 5.6 (patch confirmed)
From: MARKSTOS [...] cpan.org
On Thu Mar 09 08:59:28 2006, guest wrote: Show quoted text
> 5.6 doesn't have: > > * 3-arg open with <& &> etc. > * as much flexibility with duping from fh vs. fileno > > The attached patch makes tests pass again.
The patch supplied with this ticket also fixed failures I was seeing with 5.8.0 on FreeBSD, as reported here: http://www.nntp.perl.org/group/perl.cpan.testers/2007/03/msg429608.html The patch is simple and straightforward. I see no reason not to apply it. Mark
This is fixed in 0.5_03, and I'll bump to 0.6 as soon as I'm sure nothing broke in the last few years.
fixed in 0.6