All you need to do to run a command with options is to join them in one long string. eg.
my $process = join (" ",$execution_path, $options);
system ($process);
However, this won't work with the command prompt as you can't pass further instructions to a command line without a special option switch (/K). I don't really understand why you need to open another DOS Box to run something, as the system() command will wait for the process to terminate before continuing. Nevertheless, with the /K option, your script should open a new DOS box to run the script.
my $execution_path = "cmd.exe";
my $options = "/K C:\\Perl\\Perl.exe myscript.pl";
my $process = join (" ",$execution_path, $options);
system ($process);
However, if you can't get what you want out of system(), then check out Win32::Process, this has numerous facilities for creating and manipulating processes, you can even suspend or kill processes at a PID level. As for the TK question, I'm afriad that I haven't even started looking at TK yet.
Seems BrowserUK got there before me on the /K thing though....
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.