Pctech37 has asked for the wisdom of the Perl Monks concerning the following question:

hi! I need to create a perl script that starts a command prompt .exe that uses the script's "$temp" as a argument. any help wanted. thanks!! `Pctech37

Replies are listed 'Best First'.
Re: running exe from perl (again)
by ww (Archbishop) on Oct 16, 2009 at 02:59 UTC
Re: running exe from perl (again)
by cdarke (Prior) on Oct 16, 2009 at 08:41 UTC
    starts a command prompt .exe

    It depends on what you mean by that. ww assumed you meant a console program, but maybe you do mean a command prompt, like cmd.exe. The trick is the cmd.exe 'start' command, which creates a new console window, otherwise it will use the parent window. This is based on one I use:
    use warnings; use strict ; my $temp = '"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bi +n\vcvars32.bat"'; my $cmd = "start $ENV{comspec} /k $temp"; if (system ($cmd)) { warn 'command failed with '.$? >> 8; }