in reply to IO::Select woes
Not sure the other answers completely explained what is wrong, but: When you pipe them - both are executed and start at the 'same time' with ones output piped to the others input. This the second test.pl can start before the first has even output anything.
The fix is to execute test.pl while capturing its output. Then when that has finished, execute again with the captured output.
Or some terminals you may be able to do this in one line:perl test.pl > temp_file perl test.pl < temp_file
perl test.pl > temp_file && perl test.pl < temp_file
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: IO::Select woes
by bliako (Abbot) on May 15, 2023 at 20:09 UTC |