Here is something else I came up with after reading the docs you wrote:
my $title = "something"; #title of the input file my $executable = "C:/Users/Desktop/file.exe"; # the .exe file where the input needs to be passed my $output = "C:/Users/Desktop"; # folder where the generated output files need to be located my $outfile = "C:/Users/Desktop/$title.in"; #location of the input file open(OUTFILE,">$outfile") or die "Can't open output file $outfile\ +n"; print OUTFILE @array; close OUTFILE; my $msg = $mw->messageBox(-icon => "info", -type => "OK", -title => 'Save', -message => "File was +successfully saved."); my @args = ("start",$executable,$title); for (@args) { # Apply smart-ish double quotes if (/ /) { $_ = qq{"$_"}; } }; chdir $output; #this command isn't working on Tk system(@args) == 0 or warn "Couldn't launch '$title' : $!/$?/$^E";
This also works fine in perl but not in Tk. I think the problem here is that it doesn't locate the $output directory. I know that you chdir does nothing if the directory is not set properly. Is there another way of specifying the directory?

In reply to Re^3: Tk - system() by lil_v
in thread Tk - system() by lil_v

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.