I think you have some bad information on how Perl programs run. I also think you have some bad information on how input and output work. You might want to read up a bit on how those things happen, and you might want to share that information with whoever told you those things.
The first set of Perl code here, for example, autoflushes the output buffer after every print, does a substitution, prints, sleeps for a second, then starts with the next line.
The second instance of perl just prints everything it gets from STDIN as soon as it gets it.
perl -ne '$|++; s/print/say/; print $_; sleep 1;' ffi/test.input | per
+l -pe ''
On Linux you actually have some OS-supported options like Unix sockets, named pipes, and such. You can open a file for writing by one process and for reading by another, and the data goes from the one to the other.
Perl fully handles reading and writing lines of output in other than batch-style modes, though, as it's a general purpose programming language.
|