#!/usr/bin/perl use strict; use Tk; use Tk::ROText; ####################################################### # MAIN ####################################################### my $mw = MainWindow->new(-title=>'Tie Test'); my $appROText = $mw->Scrolled('ROText', -relief=>'ridge', -width=>100, height=>30)->pack(); my $goButton = $mw->Button(-text => 'Add text to window', command=>\&addText)->pack(); tie(*WINDOW, 'Tk::ROText', $appROText); MainLoop; sub addText { open(FILE, ") { print WINDOW $_ if (m/^\#/); } close(FILE); }