Thread windows und alarm() bzw select... (8 answers)
Opened by the-loader at 2007-07-17 14:16

sid burn
 2007-07-17 15:56
#78547 #78547
User since
2006-03-29
1520 Artikel
BenutzerIn

user image
*hust*
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl
use strict;
use warnings;
use IO::Handle;

STDIN->blocking(0);

print "Bitte etwas eingeben: ";
my $input;
for( 0 .. 100 ) {
    $input = <STDIN>;
    select undef, undef, undef, 0.1;
    last if $input;
}

if ( $input ) {
    chomp $input;
    print qq(User hat $input eingegeben\n);
}
else {
    print qq(Timeout\n);
}


Naja ist ja nur Spaß! ;)
Nicht mehr aktiv. Bei Kontakt: ICQ: 404181669 E-Mail: perl@david-raab.de

View full thread windows und alarm() bzw select...