http://www.perlmonks.org?node_id=129028


in reply to control-d out of loop?

When you type a Control-D, it simply terminates the input; the Control-D character does not get passed in as input. Anyway, if you rewrite your loop, you don't need to check for Control-D:
while($picks = <STDIN>) { chomp($picks); # do stuff }
<STDIN> will return undef when there is no more input on STDIN.