in reply to Open Control::CLI Command With Pipe

You can do this, I had the same issue last year. This is my solution.
sub waitForCmd { my $href = shift(@_); return if ( not defined $href->{settings}->{nohup} ); # wait for the file # sleep 1 while ( ! -e "$href->{settings}->{runfolder}/$href- +>{settings}->{logfile}" ); open( FH ,'<', "$href->{settings}->{runfolder}/$href->{setting +s}->{logfile}" ); # keep track of spinner # my @sails = map { "\b$_" } qw{- \ | /}; my $sail = 0; # now search each line for job completed # FILE: for (;;) { while (<FH>) { print $sails[$sail++ % @sails] ; last FILE, if ( $_ =~ /Stopping AppMonitor Co +nnector| Failure| Maximum return code ex +ceeded for the run /xi ); } seek(FH, 0, 1); } close (FH); return; }
"We can't all be happy, we can't all be rich, we can't all be lucky – and it would be so much less fun if we were. There must be the dark background to show up the bright colours." Jean Rhys (1890-1979)