in reply to Is the signal handler supposed to work like this?
Note that you still have to enter a newline after the ^D, and also, oddly, you can enter other characters between the ^D and the newline, but they will not be captured by the script.perl -wMstrict -le "my $lines = do { local $/ = qq(\cD); my $in = <STDIN>; chomp $in; $in }; print $lines " qwert asdf zx^D qwert asdf zx
Also note that this code captures the multi-line input as a single line, not as an array, but that's a detail, a mere detail!C:\@Work\Perl\monks\zemane>perl -wMstrict -le "my $lines = do { local $/ = qq(\cD); my $in = <STDIN>; chomp $in; $in }; print $lines " the cow jumped over the moo^Dn whoops! the cow jumped over the moo
|
|---|