Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading from <STDIN>

Status
Not open for further replies.

amber101

Technical User
Feb 21, 2004
2
US
hi everybody,
this is perl-newbie.
i need to read a line from user until they hit &quot;.&quot;. Then use that line with the &quot;.&quot; included. basically <STDIN> instead of \n i need to use &quot;.&quot;

thx for the response.
 
do you mean that you want to process each character as it's typed?

Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Yeah, line I enter should stop when i hit the &quot;.&quot;
just like <STDIN> without the &quot;\n&quot;
thx
 
# changer terminal eol to .
system &quot;stty eol .&quot;;
# change perl input record separator to .
$/ = &quot;.&quot;;

while (<STDIN>) {
# do whatever you like
}
 
You could also have a look at TERM::ReadKey, or getc
HTH
--Paul
 
TERM::ReadKey would be my choice

Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top