Parse:...Handle(3pm)

πŸ“¦
version 0.03 Β· 6 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay bestie so this is Parse::DMIDecode::Handle β€” the SMBIOS Structure Handle Object Class. that's the whole name, she's a whole class fr πŸ’…


✨ SYNOPSIS ✨

the vibe check, in code:

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

(yes Contians is spelled like that in the source bestie, we don't touch the code, no cap 🫢)


πŸ¦‹ DESCRIPTION πŸ¦‹

this section is empty in the original. literally nothing here. iconic minimalism, she said nothing and left 🌸


πŸ’… METHODS πŸ’…

πŸŽ€ new

creates a brand new structure handle object for you. you don't really call this yourself β€” it's called by Parse::DMIDecode's parse() method, and indirectly by its probe() method. it's giving behind-the-scenes main character energy πŸ‘‘

πŸ“ raw

my $raw_data = $handle->raw;

hands you back the raw data as generated by dmidecode β€” the exact stuff that got parsed to build this handle object in the first place. the receipts, basically 🧾

🌸 bytes

my $bytes = $handle->bytes;

🌈 address

my $address = $handle->address;

returns the address handle of the structure. so like, where she lives πŸ’œ

⭐ handle

alias for address. same girl, different name ✨

πŸ‘‘ dmitype

my $dmitype = $handle->dmitype;

πŸ¦‹ type

alias for dmitype. again β€” same energy, second name πŸ’«

πŸŽ€ description

my $description = $handle->description;

πŸ’– keywords

my @keywords = $handle->keywords;

returns a list of keyword data pairs you can retrieve out of this handle object. the lil menu of what's available πŸ“‹

🫢 keyword

for my $keyword ($handle->keywords) {
    printf("Keyword \"%s\" => \"%s\"\n",
            $keyword,
            $handle->keyword($keyword)
        );
}

🧚 parsed_structures

use Data::Dumper;
my $ref = $handle->parsed_structures;
print Dumper($ref);

returns a copy of the parsed structures. so cute, so useful β€”

⚠️ but use this one with care bestie!! it's a cloned copy of the parsed data structures that the Parse::DMIDecode::Handle object uses internally, and because of that the format may change in later releases without notice. no promises, no warnings, she's unpredictable like that 😭

πŸ”₯ SEE ALSO πŸ”₯

  • Parse::DMIDecode

πŸ’œ VERSION πŸ’œ

$Id: Handle.pm 976 2007-03-04 20:47:36Z nicolaw $

🌸 AUTHOR 🌸

Nicola Worthington <nicolaw@cpan.org>

<http://perlgirl.org.uk>

and 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>


and that's the whole page bestie, mwah πŸ’‹ this one came out of perl v5.36.0, dated 2022-10-13, and it lives under Parse::...Handle(3pm) in the User Contributed Perl Documentation section. slay, periodt πŸŽ€πŸ’–

πŸ“¦ where this page comes from