#!/usr/bin/env perl
use
strict;
use
warnings;
# Item structure.
my
$struct_hr
= {
'type'
=>
'wikibase-entityid'
,
'value'
=> {
'entity-type'
=>
'item'
,
'id'
=>
'Q123'
,
'numberic-id'
=> 123,
},
};
# Get object.
my
$obj
= struct2obj(
$struct_hr
);
# Get value.
my
$value
=
$obj
->value;
# Get type.
my
$type
=
$obj
->type;
# Print out.
"Type: $type\n"
;
"Value: $value\n"
;
# Output:
# Type: item
# Value: Q123