in reply to Re^2: Perl program to look into the phone directory and in case of a match, print the name along with the number
in thread Perl program to look into the phone directory and in case of a match, print the name along with the number
my $line =<STDIN> is a line oriented I/O method. It returns a line when it sees the EOL (End Of Line) character sequence. If EOF happens before EOL, then it (added to post: should return the line as it does with C readline) However, in my case this returns "false" so this last "not quite complete line" is not processed.
At the moment, I do not know how to get this unusual "john" last line processed. I am sure that there is a way, but right now I don't know it. Of course in your texteditor, end the john line with "enter" and all will be fine.
Update: The symptoms that I am seeing above are on an ancient Win XP laptop. The result completely surprised me! It would be helpful if the OP can replicate my results.
Update2: Hauke D got it right at Re^3: Perl program to look into the phone directory and in case of a match, print the name along with the number
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl program to look into the phone directory and in case of a match, print the name along with the number
by choroba (Cardinal) on Feb 14, 2017 at 21:14 UTC | |
by Marshall (Canon) on Feb 14, 2017 at 22:43 UTC | |
by huck (Prior) on Feb 14, 2017 at 23:02 UTC | |
by Marshall (Canon) on Feb 14, 2017 at 23:10 UTC |