#!/usr/bin/perl -w use strict; use warnings; use Tk; use Tk::HyperText; my $mw = MainWindow->new ( -title => 'HTML Viewer', ); my $hypertext = $mw->Scrolled ("HyperText", -scrollbars => 'e', -wrap => 'word', )->pack (-fill => 'both', -expand => 1); my $btnInsert = $mw->Button ( -text => 'insert', -command => \&insert, )->pack (-side => 'right'); MainLoop; insert(); sub insert{ # insert some HTML code $hypertext->insert ("end","
" . "Hello, world!"); }