Talk about having to read between the lines.
Our sys admin was trying to get this to work:
@args = ("/usr/local/bin/ldapmodify","-a -n -x -w", $pass,"-H $url", "-f $file"); print "@args"; system(@args);
The system call would fail (illegal option -), but when he copied and pasted the output of the print statement to a shell, it worked.
We kept thinking "there's more than one argument to system(), so it's not going through /bin/sh before being exectuted...".
After reading the perldoc for system() and then the man page for execvp(), we realized what was happening was that ldapmodify was being told that it's first argument was "-a -n -x -w", and of course it wasn't subsequently breaking it apart into pieces...because it expected that the shell already did that.
So, even thought the perldoc for system says to place each argument into
@args = ("/usr/local/bin/ldapmodify","-a", "-n", "-x", "-w", $pass,"-H", $url", "-f", $file);
Uh, no. That redirection is a shell thingy. No shell, no redirection!system "somecommand", "arg1", "arg2", ">outputfile";