sravs448 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Perl grep the pid and cal time taken
by kennethk (Abbot) on Jan 15, 2015 at 17:08 UTC

    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.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Perl grep the pid and cal time taken
by Anonymous Monk on Jan 15, 2015 at 16:52 UTC

    Considering you've been advised to post working code at least four times now, it's disappointing that this code does not compile.

    A reply falls below the community's threshold of quality. You may see it by logging in.