Nothing returned from system 'ps' command
[email protected] ("Julian Hiscock") Wed, 5 Jun 2002 14:40:48 +0100
| Newsgroups | perl.64bit |
|---|---|
| Message-ID | <[email protected]> |
Hi there I'm running perl on Tru64 version 5.1a. In my program I'm trying to find = out what processes are running on the host machine. To do this I'm = running the system 'ps' command:=20 @pslines =3D qx/ps -eopid,args/; Unfortunately this seems to return 0 lines about 90% of the time even = though there are processes running. Consequently I've had to embed it in = a loop to execute until it returns a list of the processes. This works = but is hardly efficient! I'm executing the command from a forked = process, although I'm not sure if this would make a difference. I've = also written a small test program containing just the loop described = above and it works fine, returning the list of processes 100% of the = time. Does anyone have any idea why this might be happening, or maybe there's = a better way to achieve the same goal? Thanks in anticipation, Julian +44 (0)20 7016 9480 (Office) +44 (0)7941 941 948 (Mobile)