in reply to Trying to use IPC::Run under mod_perl
mod_perl hates it when someone tries to close STDIN, which is what Expect is doing.
You could just fool Expect... (untested w/mod_perl)
#!/usr/bin/perl BEGIN { use IO::Handle; *Expect::STDIN = IO::Handle->new; require Expect; } # Expect closes STDIN in sub spawn my $exp = Expect->spawn('/bin/sh') or die "fubar: $!\n"; my $line = <STDIN>; print "got via STDIN: $line";
This works fine standalone. Don't know whether that passes mod_perl's scrutinity, though. For multiple spawns a local *I_FOOL_EXPECT seems more suitable than an IO::Handle object (multiple closes).
--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}
|
|---|