Hi,
(Iīve searched for processor, SMP and multiprocessor here
but didnīt find anything)
How do I find out the number of CPUs on my system elegantly.
I know of a relatively robust method under Linux, but it
seems nonperlish nor seems it elegant nor seems it portable:
open FILE, "/proc/cpuinfo";
while(<FILE>) {
if (/processor/) { $num_cpus++; }
}
close FILE;
print $num_cpus;