go ahead... be a heretic | |
PerlMonks |
Re: Docker Container Started With Docker-Compose and <STDIN>by roboticus (Chancellor) |
on Sep 12, 2019 at 17:06 UTC ( [id://11106080]=note: print w/replies, xml ) | Need Help?? |
Unless you explicitly close it, you do have an STDIN available, and the script is hanging because it's waiting for input that'll never arrive. If the script is yours or you can change it, I'd probably try:
If the script isn't yours, but you're using fork() to invoke the script, then you could try duplicating the STDIN stream and closing it before forking, so the child script won't have an open STDIN. That should make it immediately return with undef in $input. (That may require some jiggery-pokery with IO::Handle or maybe a double-fork, where the child of the initial fork can close its STDIN and then fork to the script you want to run.) ...roboticus When your only tool is a hammer, all problems look like your thumb.
In Section
Seekers of Perl Wisdom
|
|