Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The keys correspond to the affiliation.name column in the database.  The values represent the addresses (phony) of Windows Vista/2008 KMS activation servers.

This hash is serialized by DataStructure.pm::set_variable() using the YAML module's Dump function which transforms the hash into:

...

id

name

value

setby

timestamp

2

kms-configuration

---
ECU: 192.168.22.33:1688
NCSU: kms-server.ncsu.edu

new.pm:139

2009-05-26 11:35:36

To retrieve the data:

Code Block

my %kms_configuration = $self->data->get_variable('kms-configuration');my $kms_address = $kms_configuration->{$affiliation_id};

Example 2:

A more elaborate data structure is created in Perl containing an array of hashes. One of the hash values (email) can be multivalued because the value is an anonymous array:

Code Block
my @contacts = (
 {
  'firstname' => 'Joe',
  'lastname' => 'Doe',
  'email' => ['joe@somewhere.org', 'jdoe22@unity.ncsu.edu'],
  'employee_id' => 3342
 },
 {
  'firstname' => 'Jane',
  'lastname' => 'Doe',
  'email' => ['jane@somewhere.org'],
  'employee_id' => 7865
 }
);  
$self->data->set_variable('contacts', \@contacts);

DataStructure.pm::set_variable() uses YAML::Dump transforms to transform this data structure into:

...