debian man page for parse::dmidecode::examples

Query: parse::dmidecode::examples

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

Parse::DMIDecode::Examples(3pm) 			User Contributed Perl Documentation			   Parse::DMIDecode::Examples(3pm)

NAME
Parse::DMIDecode::Examples - Examples using Parse::DMIDecode::Examples
EXAMPLES
Example 1: Find the Number of Physical CPUs use strict; use Parse::DMIDecode qw(); my $dmi = Parse::DMIDecode->new( nowarnings => 1 ); $dmi->probe; my $physical_cpus = 0; for my $handle ($dmi->get_handles(group => "processor")) { my $type = ($handle->keyword("processor-type") or ""); next unless $type =~ /Central Processor/i; # Check the status of the cpu my $status = ($handle->keyword("processor-status") or ""); if ($status !~ /Unpopulated/i) { $physical_cpus++; } } printf("There %s %d physical %s in this machine. ", ($physical_cpus == 1 ? "is" : "are"), $physical_cpus, ($physical_cpus == 1 ? "CPU" : "CPUs"), );
COPYRIGHT
Copyright 2007 Nicola Worthington. This software is licensed under The Apache Software License, Version 2.0. <http://www.apache.org/licenses/LICENSE-2.0> perl v5.10.1 2009-12-02 Parse::DMIDecode::Examples(3pm)
Related Man Pages
parse::debianchangelog::util(3pm) - linux
parse::dmidecode::handle(3pm) - debian
parse::debianchangelog::changesfilters(3pm) - debian
parse::debianchangelog::util(3pm) - debian
parse::method::signatures::param(3pm) - debian
Similar Topics in the Unix Linux Community
Installing Dash Shell on OS X Lion
awk or sed - Convert 2 lines to 1 line
How can I do this in VI editor?
Introduction
How to copy a column of multiple files and paste into new excel file (next to column)?