#!/usr/local/bin/perl use Tk; my $mw = new MainWindow; # Main Window my $VARIABLE; my $frm_name = $mw -> Frame() -> pack(); my $lab = $frm_name -> Label(-text=>"Enter Celsius Value:") -> pack(); my $ent = $frm_name -> Entry(-textvariable=>\$VARIABLE) -> pack(); my $but = $mw -> Button(-text=>"Push Me", -command =>\&push_button) -> pack(); #Text Area my $frm_name2 = $mw -> Frame() -> pack(); my $lab2 = $frm_name2 -> Label(-text=>"Farienhiet:") -> pack(); my $txt = $mw -> Text(-width=>40, -height=>10) -> pack(); MainLoop; #This function will be executed when the button is pushed sub push_button { $txt->delete("1.0", 'end'); my $celsius = $ent -> get(); my $farienhiet = ($celsius*9/5)+32; $txt -> insert('end', "Farienhiet is $farienhiet degrees."); }