Content::YAML
- Class to encode and decode YAML data to and from a HASH.
Used in the same way as the placeholder class Content. See Content-class for more information.
Class to encode and decode YAML data to and from a HASH. It uses the YAML::XS module to decode and encode to and from YAML data.
same as for the Content placeholder-class. See the Content-class for more information.
In addition it has the following parameter(s):
deref Specifies if the HASH-structure that one is decoding/encoding is supposed to use references or not? Optional. Boolean. If not specified will default to 0. Valid values are either 1 (true), 0 (false).
Returns an instance of the class if successful.
Inherited from the Content-class, but in this case encodes a HASH into YAML data and returns the YAML data.
Input is the optional HASH reference to be encoded. If no HASH-reference is given, it will use the one internally to the Content-class and that are set by the set()-method.
It will return the YAML data upon success, undef upon failure. Please check the error()-method for more information.
Inherited from the Content-class, but in this case decodes YAML data into a Perl HASH. It sets the internal HASH to the decoded result upon success.
Input is a SCALAR with the YAML data. If no input is specified it will default to a blank string.
It returns a blank string upon success, undef upon failure. Check the error()-method for more information on the failure.