Subject: | exp_init fails if STDIN is tied and no fileno() in its package |
Date: | Mon, 3 Sep 2007 11:17:17 +0200 (CEST) |
To: | bug-Expect [...] rt.cpan.org |
From: | Georg Moritz <georg.moritz [...] millenux.com> |
Hello,
due to line 207 in Expect.pm v1.19 exp_init fails if STDIN is tied and
the package it is tied to doesn't have a method FILENO.
# line 207
${*$self}{exp_Pty_Handle} = "STDIN" if $self->fileno() == fileno (STDIN);
I stumbled over that using Expect in a fastcgi application where STDIN
is tied to FCGI::Stream.
# fix:
unless (tied *STDIN) {
${*$self}{exp_Pty_Handle} = "STDIN" if $self->fileno() == fileno (STDIN);
}
cheers,
--shmem
--
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s,/,($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e,e && print}