Philipp Traeder wrote:

>

...

> 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:

Are you looking for something like this, then?  Note that the child can do
its own comp;etion reporting, since STDOUT is global.:

Greetings! E:\d_drive\perlStuff>perl -w -MTerm::ReadKey
my $string;
ReadMode 4;
my $child = fork;
if ($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 {

sleep 20;
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]

Reply via email to