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

Hello fellow monks !!! A quick question, does anyone know of a *perl* way (module/method)which I can find the number of processes on a box a script is running on, on solaris I could guess I could open a pipe to mpstat and count num of lines -1, or on linux /proc/cpu info and do similar, but is there a more portable way anyone knows of ? Many Thanks

Replies are listed 'Best First'.
Re: No of processors
by valdez (Monsignor) on Jan 08, 2003 at 12:03 UTC

    There is Proc::ProcessTable, that works for Linux, Solaris and many more OSes.

    Ciao, Valerio

    Update:mce has the right answer

Re: No of processors
by mce (Curate) on Jan 08, 2003 at 12:06 UTC
    Hi,

    Search cpan for Proc, and you'll get a lot of hits f.e. this.
    ---------------------------
    Dr. Mark Ceulemans
    Senior Consultant
    IT Masters, Belgium

      I have said this wrong !!! my fault I meant to say number of *cpu's* not processes
        Ach,
        you mean Sys::CPU.

        Isn't CPAN wonderfull :-)
        ---------------------------
        Dr. Mark Ceulemans
        Senior Consultant
        IT Masters, Belgium

Re: No of processors
by PetaMem (Priest) on Jan 09, 2003 at 17:55 UTC
    Hi ropey,

    have a look at this node and the following discussion. Should contain valuable information.

    Bye
     PetaMem