File: synopsys2.pl

package info (click to toggle)
libparse-dmidecode-perl 0.03-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 336 kB
  • sloc: perl: 1,150; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 673 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl -w

use strict;

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||''))
            );
    }
}