in reply to scrollbar not working xaxis

The scrollbar IS enabled. It just doesn't seem like it because of the default Text wrap option. Try a different wrap option. For example, change line 13 to:

my $txt = $textarea -> Text(-width=>40, -height=>10, -wrap => 'none');