calling a c++ binary inside a perl script
Hi all
I have a c++ program that is called 'sim' that takes 6 parameters invoked at shell by typing './sim <x> <y> <z> <a> <b> <c>' i would like to call it inside my perl script (very much a n00b here), how do i go about that? futhermore, i would like to pass parameters to it when the perl script is invoked. Do i do that by just going: Code:
./$EXE @ARGV[0] @ARGV[1] @ARGV[2] @ARGV[3] @ARGV[4] @ARGV[5]; OS is unix. |
If you have not figured out yet, try the system() command, like
system($EXE, $ARGV[0], $ARGV[1],...) |
i dont get any error messages, and the script runs through, but it appears that the $EXE i specify does not run.
: / |
see "perldoc -f system" for how to get the error code out of system() if it's not working. If you had been running an executable out of the current directory like "./foo", you'll still need the "./" in the system() call, e.g. system("./$EXE", $arg1, $arg2)
|
All times are GMT -5. The time now is 10:13 PM. |