Perl read user input terminated by Return/Enter key, on Linux
On the Linux shell, user input read by perl with:
my $userchoice = <>;
needs to be terminated via Ctrl-D.
For my script, I require the user to enter text and terminate it with the
Return/Enter key as this is more intuitive for a novice. What are the
methods to do this? If this can be done with native perl code, I'd prefer
such a solution. I had a look at perdoc, but couldnt find an explanation
there.
No comments:
Post a Comment