Re: run an interactive command using POE::Wheel?

2009-09-28 Thread Jeremy Leader
Olivier Mengué wrote: 2009/9/24 Andreas Altergott alterg...@mira-consulting.net Please let me (us on the mailing list ;-) ) know if you do. It would be easier if the mailing list admin would reconfigure the list so we get poe@perl.org as the recipient when we choose Reply. More than once I

Re: run an interactive command using POE::Wheel?

2009-09-28 Thread Scott Wiersdorf
On Mon, Sep 28, 2009 at 01:29:29PM -0700, Jeremy Leader wrote: This seems to crop up every so often, and I've never understood why people are so reluctant to use their mail client's reply-all button/menu/command when they want to reply to all participants in a discussion. I agree. I suspect

Re: run an interactive command using POE::Wheel?

2009-09-28 Thread Tony Cook
On Mon, Sep 28, 2009 at 02:08:54PM +0200, Olivier Mengué wrote: CTRL+C gives SIGBREAK, not SIGCHLD. Ctrl C gives SIGINT. I've never seen a SIGBREAK anywhere. Tony

Re: run an interactive command using POE::Wheel?

2009-09-28 Thread woosley. xu.
ctrl-c gives a INT signal which is captured by the sub below. When the ctrl-c is captured, the code will kill the job with signal TERM, this should generate a SIGCHLD and make the wheel to exit, not in the state of zombie. sub read_from { my ($input, $exception) = @_[ARG0, ARG1]; my

Re: run an interactive command using POE::Wheel?

2009-09-26 Thread Olivier Mengué
2009/9/25 woosley. xu. redic...@gmail.com besides, if you write the interactive code like this: my $user = STDIN; chomp $user; $_[HEAP]-{job}-put($user); my $pass = STDIN; chomp $pass; $_[HEAP]-{job}-put($pass); It won't pop up all the message from the child process

Re: run an interactive command using POE::Wheel?

2009-09-26 Thread chris fedde
2009/9/26 Olivier Mengué olivier.men...@gmail.com: It would be easier if the mailing list admin would reconfigure the list so we get poe@perl.org as the recipient when we choose Reply. More than once I made the mistake of replying only to the post author. Unfortunately that would be exactly

Re: run an interactive command using POE::Wheel?

2009-09-26 Thread Olivier Mengué
2009/9/24 Andreas Altergott alterg...@mira-consulting.net Please let me (us on the mailing list ;-) ) know if you do. It would be easier if the mailing list admin would reconfigure the list so we get poe@perl.org as the recipient when we choose Reply. More than once I made the mistake of

Re: run an interactive command using POE::Wheel?

2009-09-26 Thread Erick Calder
On Sep 26, 2009, at 9:52 AM, chris fedde wrote: 2009/9/26 Olivier Mengué olivier.men...@gmail.com: It would be easier if the mailing list admin would reconfigure the list so we get poe@perl.org as the recipient when we choose Reply. More than once I made the mistake of replying only to

Re: run an interactive command using POE::Wheel?

2009-09-26 Thread woosley. xu.
Thanks, Olivier, Finally I can get the script working except one problem left: How can I reap child process? Below is my code. If I input CTRL-C when the script asking for a username or password, the script dose not exit even if I use $SIG{CHLD}='IGNORE'. By 'ps -ef', I can see that the

Re: run an interactive command using POE::Wheel?

2009-09-26 Thread Nick Perez
On Sun, 27 Sep 2009 10:59:48 +0800 woosley. xu. redic...@gmail.com wrote: $_[KERNEL]-sig_child($pid, got_child_signal); This is your problem line. Remove '$pid,' from the double quotes. -- Nicholas Perez XMPP/Email: n...@nickandperla.net http://search.cpan.org/~nperez/

Re: run an interactive command using POE::Wheel?

2009-09-26 Thread woosley. xu.
type by mistake corrected, but still don't solve the problem. 2009/9/27 Nick Perez n...@nickandperla.net On Sun, 27 Sep 2009 10:59:48 +0800 woosley. xu. redic...@gmail.com wrote: $_[KERNEL]-sig_child($pid, got_child_signal); This is your problem line. Remove '$pid,' from the double

run an interactive command using POE::Wheel?

2009-09-24 Thread woosley. xu.
hi all, I want to run a interactive command using POE::Wheel, I met some problem. Here is my code: ###main.pl use POE qw( Wheel::Run ); POE::Session-create( inline_states = { _start = \on_start, got_child_stdout = \on_child_stdout, got_child_stderr

Re: run an interactive command using POE::Wheel?

2009-09-24 Thread Andreas Altergott
Hi, woosley. xu. wrote: Apparently I failed to get the password but get the last \n in the first input to password. But if I got rid of \n, the whole script just blocked. How can I deal with such a situation? I didn't find the error, but I've written your application a little bit different.

Re: run an interactive command using POE::Wheel?

2009-09-24 Thread woosley. xu.
-- Forwarded message -- From: woosley. xu. redic...@gmail.com Date: 2009/9/25 Subject: Re: run an interactive command using POE::Wheel? To: Andreas Altergott alterg...@mira-consulting.net Hi, Andreas, Thanks for your reply. I found if I changed the my code

Re: run an interactive command using POE::Wheel?

2009-09-24 Thread Scott Wiersdorf
On Fri, Sep 25, 2009 at 10:47:07AM +0800, woosley. xu. wrote: Still I don't know why I can not put a \n after each words, perldoc POE::Wheel::Run says *POE::Wheel::Run communicates with the child process in a line-based fashion by default* If you look at the documentation for