in reply to Can't execute system() when called from servlet

Does $fooDir contain spaces? Why are you adding the extra quotes around the command name?

You really should be checking the return value of system: system(...) == 0 or die "system failed, \$?=$?"; (see the docs for more detailed error checking).

Also, I'm sure you know you really should be using strict.

You probably should look into some modules such as IPC::Run3 or IPC::System::Simple for easier and "safer" execution of external commands.

Lastly, you can look into modules such as File::Spec, File::Path and friends for better handling of filenames and file operations.

Replies are listed 'Best First'.
Re^2: Can't execute system() when called from servlet
by Anonymous Monk on May 28, 2014 at 16:59 UTC

    Forgot one: Are you sure that $fooDir is always an absolute pathname?