Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Re: A few random questions.

by SquireJames (Monk)
on Dec 10, 2003 at 01:06 UTC ( #313628=note: print w/replies, xml ) Need Help??


in reply to Re: Re: A few random questions.
in thread A few random questions.

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....

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://313628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2022-07-06 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?