Hi,
I have a few questions regarding the system command, and how it can be implemented. I have a program that is in my search path that I call on in the terminal by typing "paup".
Once the program is called on it loads inside the terminal, and it has its own set of commands. You can leave the program at any time by typing "quit".
I would like a perl script to feed input with a loop into this data-calculating program, but I am running into some problems.
When I execute my script in the terminal, it starts the program but won't run any of the commands that I give it. I have all the system commands except for the start in a 100x for loop.
system 'paup'; #to start the program
for ( $i=0; $i<100; $i++ )
{
system 'somecommand'; #some command to feed into the program
system 'somecommand'; #some command to feed into the program
system 'somecommand'; #some command to feed into the program
system 'somecommand'; #some command to feed into the program
}
I would like these commands to feed into the program but as of now they are not - when the script is executed the program starts but the loop doesn't begin or if i include the "system 'paup'; into the loop it never reaches the second clause.
Am I using system right? I'm a little confused by how it works other than that it feeds commands into the terminal. How would I go about giving this program that I'm running commands that are given to it by a perl script?
Thanks!!!!!!!!!!!
I have a few questions regarding the system command, and how it can be implemented. I have a program that is in my search path that I call on in the terminal by typing "paup".
Once the program is called on it loads inside the terminal, and it has its own set of commands. You can leave the program at any time by typing "quit".
I would like a perl script to feed input with a loop into this data-calculating program, but I am running into some problems.
When I execute my script in the terminal, it starts the program but won't run any of the commands that I give it. I have all the system commands except for the start in a 100x for loop.
system 'paup'; #to start the program
for ( $i=0; $i<100; $i++ )
{
system 'somecommand'; #some command to feed into the program
system 'somecommand'; #some command to feed into the program
system 'somecommand'; #some command to feed into the program
system 'somecommand'; #some command to feed into the program
}
I would like these commands to feed into the program but as of now they are not - when the script is executed the program starts but the loop doesn't begin or if i include the "system 'paup'; into the loop it never reaches the second clause.
Am I using system right? I'm a little confused by how it works other than that it feeds commands into the terminal. How would I go about giving this program that I'm running commands that are given to it by a perl script?
Thanks!!!!!!!!!!!