Perl/Tk saves your favorite tools

Main
back: PPresenter
next: Encapsulation -2

One-way communication is simple. You can use
  • qx(myprogram) to wait for the result, and then reformat that into a Tk-interface, or
  • open("myprogram |") to process each line of output of the program the moment it is produced. In this case, the program and your Perl/Tk program run in parallel.

Two-way communication is simple to start but...

  • both programs must flush each line: only few Unix commands can do that.
  • Open3 requires select() instead of just <>

In general, communication is only possible if both programs are aware of it. In most case, you need both programs to turn internal buffering off, certainly in case of two-way communication.

 
PPresenter Encapsulation -2

Created by Mark Overmeer with PPresenter on 22 May 2000.