sigar/bindings/perl/examples/cpu_info.pl

20 lines
385 B
Perl
Raw Normal View History

2004-06-22 06:37:04 +08:00
#!/usr/bin/perl
use strict;
use Sigar;
my $sigar = new Sigar;
my $infos = $sigar->cpu_infos;
my $num = scalar @$infos;
print "$num total CPUs..\n";
for my $info (@$infos) {
print "Vendor........" . $info->vendor . "\n";
print "Model........." . $info->model . "\n";
print "Mhz..........." . $info->mhz . "\n";
print "Cache size...." . $info->cache_size . "\n";
}