Philipp Traeder wrote:
Hi Phillip,
Sorry. That last example cheated with a long, hard-coded wait. Below is
something that speaks a little more closely to the problem.
...
> b) How can I set up the ReadLine() part in a way that the user is able
> to type new actions, but can receive new messages (from finished long
> actions) as well? I have played around with Term::ReadKey, and ended up
> with something like this:
The waitpid ($child_pid, 0) function should do something like this:
Greetings! E:\d_drive\perlStuff>perl -w -MTerm::ReadKey
my $string;
ReadMode 4;
my $child = fork;
if (not $child) {
while (1) {
if (my $char = ReadKey) {
if ($char =~ /[a-zA-Z0-9 ]/) {
$string .= $char;
print '*';
} elsif ($char ne '!') {
$string .= $char;
print $char;
} else {
$string .= $char;
print '*';
last;
}
}
}
print "\n$string\n";
} else {
waitpid $child, 0;
print "Child process all done-done\n";
}
^Z
**********,******,***************
What silly, geeky, games we play!
Child process all done-done
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]