freelanceprogrammers.org Forum Index » Perl
readline <STDIN> without waiting.
Joined: 07 Mar 2005
Posts: 6
readline <STDIN> without waiting.
Exists any way to readline enter in a loop when enter in STDIN input.
I need a input but not depends a user entry to program continue
running.
It`s also like something to tkRunning(1) BUT to <STDIN> :)
"tkRunning - makes Tk event loop run when waiting for user input
(i.e., during readline method). "
anybody knows ? :)
tks !
Joined: 07 Mar 2005
Posts: 4
readline <STDIN> without waiting.
--- In perl_official@yahoogroups.com, Garcia <garciajr@g...> wrote:
>
> Exists any way to readline enter in a loop when enter in STDIN input.
> I need a input but not depends a user entry to program continue
> running.
>
> It`s also like something to tkRunning(1) BUT to <STDIN> :)
>
> "tkRunning - makes Tk event loop run when waiting for user input
> (i.e., during readline method). "
>
> anybody knows ? :)
>
> tks !
my $rin=``;
my $rout;
vec($rin,fileno STDIN,1)=1;
while( !select($rout=$rin, undef, undef, 0) ){
print "continue running
";
sleep 1;
}
$_ = <STDIN>;
print $_;
Joined: 21 May 2004
Posts: 44
readline <STDIN> without waiting.
>>>>> "whinnim" == whinnim <dmi@...> writes:
whinnim> while( !select($rout=$rin, undef, undef, 0) ){
whinnim> print "continue running
";
whinnim> sleep 1;
whinnim> }
whinnim> $_ = <STDIN>;
whinnim> print $_;
Do not mix buffered input (like reading <STDIN>) with select().
Bad Things Will Happen.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







