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 '&#1054;&#1096;&#1080;&#1073;&#10 +82;&#1072; &#1089;&#1086;&#1079;&#1076;&#1072;&#1085;&#1080;&#1103; & +#1090;&#1088;&#1091;&#1073;&#1099; '.$svitok_truby.' : '.$!; local $SIG{CHLD} = "IGNORE"; # &#1056;&#1086;&#1076;&#1080;&#1090;&#1077;&#1083;&#1100;. if( $nomer_vosproizvodyshchego_protsessu=fork ){ use IO::Handle; open( $FIFO, '>'.$svitok_truby ) || die '&#1053;&#1077; &#1086;&#109 +0;&#1082;&#1088;&#1099;&#1090;&#1100; &#1090;&#1088;&#1091;&#1073;&#1 +091; '.$svitok_truby.' &#1085;&#1072; &#1079;&#1072;&#1087;&#1080;&#1 +089;&#1100; : '.$!; # 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; } } # &#1056;&#1077;&#1073;&#1105;&#1085;&#1086;&#1082;. }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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.