Sun751 prefers to create a new thread for each tiny aspect of the real problem.
Sun751, it would be easier to stay in one thread for the entire problem, this would give other monks more context to work with, and it would avoid repeated answers that don't help you. Of course, it would be helpful to explain the real problem.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] [Watch: Dir/Any] |
You don't give us much to go by here, but I suspect do EXPR i.e; eval a file; might be a good place to start. As long as your commands are valid perl expression (including self-defined subroutines), it'll just work.
--
In Bob We Trust, All Others Bring Data.
| [reply] [Watch: Dir/Any] |
As you should know from reading ikegami's reply on your other thread about this problem, if you want to run a set of commands "in sequential order one by one", you want these things in an array (or maybe an array of hashes, as ikegami suggested), not in a hash.
Assuming that the sequence of commands does not involve anything that requires manual interaction by prompting for user input from "stdin", the easiest thing is to have the list of commands as plain text, one command per line, and execute each one in turn, in any of several ways.
With unix/linux, this sort of text file is also known as a "shell script", which could just be executed on its own using the shell (e.g. source command_list.file or just . command_list.file) -- no need for perl, really.
Is there something you need to do that a simple shell script doesn't do for you? | [reply] [Watch: Dir/Any] [d/l] [select] |
It is not clear to me what you are trying to do. The most simple way to do this is a shell script or a .bat file if there are no decisions to be made.
In general, I would recommend against putting any code that you run with eval{} into a config file. There can be very good reasons to do this, but until you understand what they are, DON'T do it. There can be big security holes with this and very unexpected results can result.
There are a number of great Perl modules that can help with this. Can you give us say 5 lines of input and what you figure those 5 lines should do?
| [reply] [Watch: Dir/Any] |