I added the autoflush ahd its module -- still effect is the same. -- Repetings became necessary up to 7 instead up to 3 w/ the shell version.
I have no ideas what to do except to find the piece of code i have written long time ago for such a task -- that i remembere worked perfect. But do not know where the code is.
Here are the last changes:
use warnings; use strict; use utf8::all; use POSIX qw( mkfifo ); mkfifo( $svitok_truby, 0700 ) || die 'Ошиб
 +82;а создания & +#1090;рубы '.$svitok_truby.' : '.$!; local $SIG{CHLD} = "IGNORE"; # Родитель. if( $nomer_vosproizvodyshchego_protsessu=fork ){ use IO::Handle; open( $FIFO, '>'.$svitok_truby ) || die 'Не оm +0;крыть труб +091; '.$svitok_truby.' на запи +089;ь : '.$!; # Same thing? -- I.e. not working? $|=1; $FIFO->autoflush( 1 ); use Term::ReadKey; ReadMode 'cbreak'; while( 1 ){ $knopka=&ReadKey( 0 ); if( $knopka eq ' ' ){ print $FIFO 'pause'; }elsif( $knopka eq '0' ){ print $FIFO 'quit'; last; } } # Ребёнок. }else{ for( $i=0; $i<=$#svitok_na_vosproizvedenie; $i++ ){ system( '/usr/bin/mplayer -slave -input file='.$svitok_truby.' '.$ +svitok_na_vosproizvedenie_kom[$i] ); } } ReadMode 'normal'; close( FIFO ); unlink $svitok_truby;
Thanks for your answers.
In reply to Re^4: To organize pipe right way.
by nikolay
in thread To organize pipe right way.
by nikolay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |