in reply to Re^2: Tk - system()
in thread Tk - system()
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?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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Tk - system()
by zentara (Cardinal) on Aug 06, 2008 at 19:46 UTC | |
by lil_v (Sexton) on Aug 06, 2008 at 20:32 UTC | |
by zentara (Cardinal) on Aug 07, 2008 at 10:53 UTC |