Config::Apple::Profile::Payload::Tie::Dict - Tying class for dictionaries of things.
This class is used to store a dictionary (a dict) of things. Exactly what things are being stored is specified at the time the tie is made.
There are several payload types that contain dicts of things. For example, if you have a Wi-Fi network that uses WPA- or WPA2-Enterprise, then some form of EAP will be used, and the EAP parameters are stored in a dictionary.
This class is used by payload classes to represent a dictionary.
When this class is tied to an hash, TIEHASH will be called, with the class name as the first argument.
TIEHASH
$validator is a reference to a function that will be able to validate values that are stored in the dict. The validator will be passed the value as the only parameter, and an untained value is expected as the return value. If undef is returned by the validator, then the value was invalid, and the store attempt will fail.
$validator
undef
It is suggested that the functions from Config::Apple::Profile::Payload::Types::Validation be used.
If $validator is not a valid coderef then an exception will be thrown.
Works as one would expect with a Perl hash. Returns the entry matching the specified key.
Works almost as one would expect with a Perl hash. Stores a value at the specified key. The value will only be stored if it is valid; otherwise an exception will be thrown. undef is not a valid value to store.
Works as one would expect with a Perl hash. Deletes the specified key from the hash.
Works as one would expect with a Perl hash. Deletes all keys from the hash.
Works as expected for a Perl hash. Returns true if the specified key exists in the hash.
Used as part of keys() and each(). Works as expected for a Perl hash. Returns the first key in the hash.
keys()
each()
Used as part of keys() and each(). Works as expected for a Perl hash. Returns the next key in the hash.
Works as expected, returning the number of keys in the hash.
Refer to Config::Apple::Profile for acknowledgements.
A. Karl Kornel, <karl at kornel.us>
<karl at kornel.us>
Copyright © 2014 A. Karl Kornel.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Config::Apple::Profile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Config::Apple::Profile
CPAN shell
perl -MCPAN -e shell install Config::Apple::Profile
For more information on module installation, please visit the detailed CPAN module installation guide.