clrobert has asked for the wisdom of the Perl Monks concerning the following question:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: External programs
by cleen (Pilgrim) on Jul 20, 2000 at 19:34 UTC | |
| [reply] |
|
Re: External programs
by tye (Sage) on Jul 20, 2000 at 19:47 UTC | |
Trying to guess what you meant, I think you are complaining that the script waits for the program to finish before continuing to the code after system. I think the undocumented (at least until recently) incantation will prevent the script from waiting (I know it will under OS/2 and Win32, but I think that it has been ported to the majority of Perl platforms). Other solutions were specific to the type of operating system you were using. ...but I'm not sure that this is what you meant. Could you be more... specific? Some sample lines of code is often a big help. Also, "doesn't work" is never a good description of a failure. Do you get an error message? What did you expect that didn't happen? What happened that you didn't expect? | [reply] [d/l] [select] |
|
RE: External programs
by JanneVee (Friar) on Jul 20, 2000 at 19:43 UTC | |
e.g.
| [reply] [d/l] |
|
Re: External programs
by cwest (Friar) on Jul 20, 2000 at 19:57 UTC | |
But, as cleen writes, you aren't being very clear. This will help you if your question is what I think it is. (you can ignore the $\ assignments, that's me testing lazily :) and PROG looks like this: If your question doen't involve the second program being Perl, then my example won't work... but I can't think of how to do it without starting a new process... I haven't had my coffee either. Enjoy! -- Casey | [reply] [d/l] [select] |
|
Re: External programs
by JP Sama (Hermit) on Jul 21, 2000 at 04:01 UTC | |
What if you run in serverA a testa.pl, that runs another program : testb.pl in serverB, and with the testb.pl, you could run locally your batch (test.bat) file. I know this SUX... but i think it would work! (please Wise monks : kill me if i gave a nonsense reply... so i can learn something with my errors!)
| [reply] [d/l] |
|
Re: External programs
by clrobert (Initiate) on Jul 20, 2000 at 22:22 UTC | |
| [reply] |
by tye (Sage) on Jul 20, 2000 at 22:35 UTC | |
To cause a program to run on another server, you'd need a protocol for doing that. Under NT, "Remote Cmd" (aka "RCmd") from the resource kit is not bad (rlogin and rsh from the resource kit are not good). If you installed the service on serverB, the service was running, you have rcmd.exe on serverA, and you are properly authenticated to serverB, then you could use: But I won't go into this further because I don't think that is the best solution in this particular case. When you run a program from Explorer, it usually runs the program with its default directory set to the directory where Explorer found the program. It sounds like just setting the default directory before running the program may fix your problem. Now, you can't chdir('//serverB/directory$') because non-kernel processes on NT need a drive letter for their current directory. So you need to map a drive letter to that directory and chdir to the root directory of that drive. Win32::NetResource will let you map and unmap the drive letter. I don't have Win32::NetResource examples handy or memorized so here is a non-Perl solution:
| [reply] [d/l] [select] |
by cwest (Friar) on Jul 20, 2000 at 22:47 UTC | |
-- Casey | [reply] [d/l] |