in reply to open on ssh command stuck

Working for me. But, if <LS> is hanging it has to be because no \n is received. Add 2>&1 to the open command, maybe you are getting an error you aren't seeing due to not capturing STDERR.
#!/usr/bin/perl open(LS, qq{ssh -p 22 onelesd\@localhost "if [ -d /home/foo/bar/201108 +26 ] ; then echo 1 ; else echo 0 ; fi" 2>&1 |}); my $baz = <LS>; print $baz ;
MacBook-Pro:Downloads onelesd$ ./script.pl 0 MacBook-Pro:Downloads onelesd$

Replies are listed 'Best First'.
Re^2: open on ssh command stuck
by lackita (Sexton) on Aug 29, 2011 at 14:29 UTC
    That didn't seem to help. How would I be able to cause a \n to be received?