Patch for this problem.
--- /usr/share/perl5/CGI/Emulate/PSGI.pm 2012-03-18 19:07:34.000000000 +0000
+++ CGI/Emulate/PSGI.pm 2013-08-08 13:37:20.834443137 +0000
@@ -10,6 +10,28 @@
our $VERSION = '0.14';
+package CGI::Emulate::PSGI::Handle;
+
+require Tie::Handle;
+our @ISA = qw(Tie::Handle);
+
+sub READ {
+ my $self = shift;
+ my $bufref = \$_[0];
+ my (undef, $len, $offset) = @_;
+ my $buf;
+ my $ret = $$self->read($buf, $len, $offset);
+ $$bufref = $buf;
+ $ret;
+}
+
+sub TIEHANDLE {
+ my ($class, $ref) = @_;
+ bless \$ref, shift
+ }
+
+package CGI::Emulate::PSGI;
+
sub handler {
my ($class, $code, ) = @_;
@@ -21,7 +43,8 @@
{
local %ENV = (%ENV, $class->emulate_environment($env));
- local *STDIN = $env->{'psgi.input'};
+ local *STDIN;
+ tie (*STDIN, 'CGI::Emulate::PSGI::Handle', $env->{'psgi.input'});
local *STDOUT = $stdout;
local *STDERR = $env->{'psgi.errors'};