my $addGoalButn = $features->Button(-text=>'Add Goal', -command=> \&mkDialogBox, )->pack(); sub mkDialogBox { $n_prompt = $main->DialogBox(-title=>"Add a \$ value and explanation", -buttons=>["OK","Cancel"]); $n_prompt->add(Label, -text=>"\$")->pack(-side => 'left'); $numNewGoal = $n_prompt->add(Entry)->pack(-side => 'left'); $descNewGoal = $n_prompt->add(Text, -height=>'5', -width=>'30')->pack(-side => 'left'); $n_prompt->Show(); $num = $numNewGoal->get(); $desc = $descNewGoal->get("1.0", "end"); #paid upgrade option: rewrite below for Excel/SQL connectivity $desc =~ s/\s*$/\n/; (open(GF, ">>$file_goals") and print GF join("\n", $num, $desc) and close GF) or warn "unable to save date to $file_goals\n"; }