use strict; use Sys::Info; use Sys::Info::Constants qw( :device_cpu ); my $info = Sys::Info->new; my $cpu = $info->device('CPU'); printf "CPU: %s\n", scalar($cpu->identify) || 'N/A'; printf "CPU speed is %s MHz\n", $cpu->speed || 'N/A'; printf "There are %d CPUs\n" , $cpu->count || 1; printf "CPU load: %s\n" , $cpu->load || 0; exit;