Hello. I am trying to run a second script after I exit a menu created by Tk. The problem I am having is my code is stopping at MainLoop; and not running my last line of code. Is there a secret to this? Please see below:

use strict; use warnings; use Tk; my $mw = MainWindow->new; $mw->geometry("300x500"); $mw->title("Unforecasted Jobs"); my $check1 = 'NOT CHECKED'; my $check2 = 'NOT CHECKED'; my $check3 = 'NOT CHECKED'; my $check4 = 'NOT CHECKED'; my $check_frame = $mw->Frame()->pack(-side => "top"); $check_frame->Label(-text=>"Jobs That Do Not Forecast")->pack(-side => + "top")->pack(); my $job = "18L"; my $chk1 = $check_frame->Checkbutton(-text => '18-Letters', -variable => \$check1, -onvalue => 'ADDED', -offvalue => 'NOT CHECKED')->pack +(), -command => print OUTFILE "$job\n +"; my $job2 = "07O"; my $chk2 = $check_frame->Checkbutton(-text => '07-Orders', -variable => \$check2, -onvalue => 'ADDED', -offvalue => 'NOT CHECKED')->pack +(), -command => print OUTFILE "$job2\ +n"; my $job3 = "36L"; my $chk3 = $check_frame->Checkbutton(-text => '36-Letters', -variable => \$check3, -onvalue => 'ADDED', -offvalue => 'NOT CHECKED')->pack +(); -command => print OUTFILE "$job3\ +n"; my $job4 = "38L"; my $chk4 = $check_frame->Checkbutton(-text => '38-Letters', -variable => \$check4, -onvalue => 'ADDED', -offvalue => 'NOT CHECKED')->pack +(), -command => print OUTFILE "$job4\ +n"; my $button_frame = $mw->Frame()->pack(-side => "bottom"); my $ok_button = $button_frame->Button(-text => 'OK', -command => \&check_sub)->pack( +-side => "left"); my $exit_button = $button_frame->Button(-text => 'Exit', -command => sub{exit})->pack(- +side => "right"); sub check_sub { my $check_msg = "Check #1: $check1\nCheck #2: $check2\nCheck #3: $ch +eck3\nCheck #4: $check4\n; $mw->messageBox(-message => "Check Button Summary:\n$check_msg", -ty +pe => "ok"); } MainLoop; my $var =`crossref.pl`; #This is not executing.

In reply to Code after MainLoop; Tk by PerlCowboy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.