I attempted to write a Perl script to take user input. I am on Windows 8 and Cygwin.
When I try to run my code it expects user input as it should, but when I attempt to press Ctrl-D the program still tries to accept input instead of signalling the end of input.
Here is my code below. Why is this the case? Is there a way I can overcome this without switching away from Cygwin? I do not want to press Ctrl-Z or Ctrl-C as I don't want to stop the execution of the program.
#!/usr/bin/perl
while ( $line = <> ) {
print $line;
}