This seems a lot like homework. Please excuse my presumption if I am incorrect. The general policy around here is that we are happy to help people learn, but we won't do your homework for you because then you are less likely to actually learn. Please qualify it as homework, and then explain the part you are having trouble with.
I also note that the posted code does not compile; Global symbol "@pids" requires explicit package name at line 45. You also put a prototype on your getParameters definition, but violated your prototype in calling it. As per How do I post a question effectively?, please try code snippets before you post so that we can actually help you with the question at hand, rather than being snarky about variable and subroutine definitions.
How can I grep the process Id and store it an array and calculate the time taken by it?
Assuming you repair the bugs listed above, you've already grepped the process Ids and stored them in the array @process_ids. Of course, you are also editing your posted code as I'm writing this, which makes this a moving target.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re: Perl grep the pid and cal time taken
by kennethk
in thread Perl grep the process id and calculate time taken
by sravs448
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |