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

I am having trouble executing a program that has a gui with an associated user and password. In a batch file it works OK: ACXMLAI -gui -u:"carter" -p:"welcome", where ACXMLAI is the executable program, carter is the username and welcome is the password. The exec command does not seem to work in Win32 so I used system: system("C:\\Program Files\\Kofax\\Capture\\bin\\ACXMLAI -gui -u:"carterjg" -p:"kofax"");. Perl is confused with the quotes around the username and password, but the gui requires them. The perl error is "Bareword found where operator expected at perltest.pl line 1, near "C:\\Program Files\\Kofax\\Capture\\bin\\ACXMLAI -gui -u:"carterjg" (Missing operator before carterjg?)Is there a way to execute a program with the gui user and password? Thanks so much for your time, Jeff

Replies are listed 'Best First'.
Re: Executing program gui
by ikegami (Patriarch) on Dec 08, 2009 at 17:46 UTC

    system("C:\\Program Files\\Kofax\\Capture\\bin\\ACXMLAI -gui -u:"carterjg" -p:"kofax"");
    should be
    system("C:\\Program Files\\Kofax\\Capture\\bin\\ACXMLAI -gui -u:\"carterjg\" -p:\"kofax\"");
    or
    system('C:\\Program Files\\Kofax\\Capture\\bin\\ACXMLAI -gui -u:"carterjg" -p:"kofax"');

Re: Executing program gui
by moritz (Cardinal) on Dec 08, 2009 at 17:42 UTC
    Try the LIST form of system:
    system('C:\\Program Files\\Kofax\\Capture\\bin\\ACXMLAI', '-gui', '-u:carter', '-p:welcome', ) and warn "Can't execute ACXMLAI: $?";