Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Docker Container Started With Docker-Compose and <STDIN>

by haukex (Archbishop)
on Sep 12, 2019 at 17:53 UTC ( [id://11106083]=note: print w/replies, xml ) Need Help??


in reply to Docker Container Started With Docker-Compose and <STDIN>

my $input = <STDIN>; It is clear that this will not work in my container because there is no standard input. I want it to fail and bail out. The problem is that it never returns. How can I detect that situation in a clean way?

If you want to detect whether the user can enter input (not directly whether it's running inside a Docker container), I'd suggest IO::Interactive, or at the very least -t STDIN. Or, you could use a prompting module instead, depending on what you're actually trying to implement.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11106083]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found