系统::信息 - 问题

时间:2011-07-14 06:23:21

标签: perl device

来自Sys::Info::Device
If DEVICE_ID has the value of available, then the names of the available devices will be returned.

为什么$info->device('available');在至少有cpu-device时才返回设备?

#!/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

1 个答案:

答案 0 :(得分:2)

我在Mac OS X上运行相同的输出。您可以联系developer