Interapplication Communication

You can use the send command to have Perl/Tk (and even Tcl/Tk) applications communicate back and forth. The arguments include an application to talk to and the command to execute in that application.

$widget->send("application" => callback);

You can also specify the option -async, which will return control immediately instead of waiting for the callback to execute. For complete details, see "IPC with send".

Tk::Receive($widget, "command") and be careful what you do with the command string. Allowing any application to send unknown commands to your application can be dangerous. Use the interps method to get a list of valid application names.

When engaging in interapplication communication, it is a good idea to run your Perl script with the -T switch, which forces taint checking. Again, see "IPC with send" for complete details and working programs.