#! /usr/bin/perl use strict; use Socket; use Tk; use Tk::FileSelect; use FileHandle; my $top= MainWindow->new(); my $txtw = $top->Text->pack(); my $fnm = $top->FileSelect()->Show(); my $rd = new FileHandle; my $wr = new FileHandle; pipe $rd, $wr; if ( fork() ) { $top->fileevent($rd,'readable',\&insert); MainLoop; } else { open I,$fnm; print $wr $_ while($_=); }