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 )