Smbios structure handle object class
use Parse::DMIDecode qw(); my $decoder = new Parse::DMIDecode; $decoder->probe; for my $handle ($decoder->get_handles) { printf("Handle %s of type %s is %s bytes long (minus strings).\n". " > Contians the following keyword data entries:\n", $handle->handle, $handle->dmitype, $handle->bytes ); for my $keyword ($handle->keywords) { my $value = $handle->keyword($keyword); printf("Keyword \"%s\" => \"%s\"\n", $keyword, (ref($value) eq 'ARRAY' ? join(', ',@{$value}) : ($value||'')) ); } }
Create a new struture handle object. This is called by Parse::DMIDecode's parse() (and indirectly by probe()) methods.
my $raw_data = $handle->raw;
Returns the raw data as generated by dmidecode that was parsed to create this handle object.
my $bytes = $handle->bytes;
my $address = $handle->address;
Returns the address handle of the structure.
Alias for address.
my $dmitype = $handle->dmitype;
Alias for dmitype.
my $description = $handle->description;
my @keywords = $handle->keywords;
Returns a list of keyword data pairs available for retreival from this handle object.
for my $keyword ($handle->keywords) { printf("Keyword \"%s\" => \"%s\"\n", $keyword, $handle->keyword($keyword) ); }
use Data::Dumper; my $ref = $handle->parsed_structures; print Dumper($ref);
Returns a copy of the parsed structures. This should be used with care as this is a cloned copy of the parsed data structures that the Parse::DMIDecode::Handle object uses internally, and as such may change format in later releases without notice.
Parse::DMIDecode
$Id: Handle.pm 976 2007-03-04 20:47:36Z nicolaw $
Nicola Worthington <[email protected]>
<http://perlgirl.org.uk>
If you like this software, why not show your appreciation by sending the author something nice from her Amazon wishlist ?
<http://www.amazon.co.uk/gp/registry/1VZXC59ESWYK0?sort=priority>
Copyright 2006 Nicola Worthington.
This software is licensed under The Apache Software License, Version 2.0.
<http://www.apache.org/licenses/LICENSE-2.0>