in reply to Re: control-d out of loop?
in thread control-d out of loop?
Roger that.
In even more other words, you don't actually get a Ctrl-D character (the OS eats it); instead you will see EOF, which is a testable condition embodied by the <> operator returning undef. Here's the same example again using the implicit $_ variable:
while (<>) { chomp; #do stuff (with $_) }
dmm
You can give a man a fish and feed him for a day ... Or, you can teach him to fish and feed him for a lifetime
|
---|