2011-07-14 172 views
3

Sys::Info::Device
If DEVICE_ID has the value of available, then the names of the available devices will be returned.Sys系統::信息 - 問題

爲什麼$info->device('available');回報沒有設備時,至少有CPU的設備?

#!/usr/local/bin/perl 
use warnings; 
use 5.014; 
use Sys::Info; 

my $info = Sys::Info->new; 

my @available = $info->device('available'); 
say 'Available devices: ', scalar @available; 

my $cpu = $info->device('CPU'); 
say 'Number of cores: ', $cpu->count; 

輸出:

可用設備:0
芯數:2

回答

2

我得到的是Mac OS X的機器上運行此相同的輸出。您可以聯繫developer