$keyword, $decoder->keyword($keywords) );
solved the problem:
Update: It's been awhile since I used Parse::DMIDecode. I remembered that the "mistake" is not a mistake. In other words, what you are seeing is exactly what Parse::DMIDecode should be doing. You are entering "slot", but "slot" is not a keyword but a "type". A "keyword" is a "string". If you enter a type, dmidecode will return a list of all valid keywords, which is what is happening. For example, a keyword would be something like system-version, processor-manufacturer, etc. Dmidecode has a good man page. Be sure to check it out.#!/usr/local/bin/perl use strict; use warnings; use Parse::DMIDecode; my $decoder = Parse::DMIDecode->new( dmidecode => "/usr/sbin/dmidecode", nowarnings => 1, ); $decoder->probe; my @keywords = $decoder->keywords; for my $keyword (@keywords) { printf("%s => %s\n", $keyword, $decoder->keyword($keyword) ); }
Update: Just a little script to look at the "slot" type:
#!/usr/bin/perl use strict; use warnings; use Parse::DMIDecode; my $decoder = Parse::DMIDecode->new( dmidecode => '/usr/sbin/dmidecode', nowarnings => 1, ); $decoder->probe; printf("System: %s => %s %s %s %s\n", $decoder->keyword("slot-current-usage"), $decoder->keyword("slot-designation"), $decoder->keyword("slot-id"), $decoder->keyword("slot-length"), $decoder->keyword("slot-type"), ); my $total_structures = $decoder->structures; printf("Structures: %s\n", $decoder->structures($total_structures), );
I added $decoder->structures($total_structures). It'll tell how many "types" there are. I got 40---numbered starting at 0 thru 39.
In reply to Re: parse dmidecode keywords
by Khen1950fx
in thread parse dmidecode keywords
by perldesire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |