lackita has asked for the wisdom of the Perl Monks concerning the following question:
open(LS, qq{/usr/local/openssh/bin/ssh -p 22 foo\@localhost "if [ -d / +home/foo/bar/20110826 ] ; then echo 1 ; else echo 0 ; fi" |}); my $baz = <LS>;
The code hangs on me indefinitely. The strange thing is that, if I put it in a one-liner, it runs fine. Any ideas?
EDIT: I found the issue. The code had set
to solve another issue, and this caused the process to sit in an infinite loop after termination.local $SIG{CHLD} = sub { 1 until waitpid(-1 , WNOHANG) == 1; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: open on ssh command stuck
by onelesd (Pilgrim) on Aug 26, 2011 at 23:12 UTC | |
by lackita (Sexton) on Aug 29, 2011 at 14:29 UTC |