Venus::Yaml - Yaml Class
Yaml Class for Perl 5
package main; use Venus::Yaml; my $yaml = Venus::Yaml->new( value => { name => ['Ready', 'Robot'], version => 0.12, stable => !!1, } ); # $yaml->encode;
This package provides methods for reading and writing YAML data. Note: This package requires that a suitable YAML library is installed, currently either YAML::XS 0.67+, YAML::PP::LibYAML 0.004+, or YAML::PP 0.23+. You can use the VENUS_YAML_PACKAGE environment variable to include or prioritize your preferred YAML library.
YAML::XS
0.67+
YAML::PP::LibYAML
0.004+
YAML::PP
0.23+
VENUS_YAML_PACKAGE
This package has the following attributes:
decoder(CodeRef)
This attribute is read-write, accepts (CodeRef) values, and is optional.
(CodeRef)
encoder(CodeRef)
This package inherits behaviors from:
Venus::Kind::Utility
This package integrates behaviors from:
Venus::Role::Accessible
Venus::Role::Buildable
Venus::Role::Explainable
Venus::Role::Valuable
This package provides the following methods:
decode(Str $yaml) (Any)
The decode method decodes the YAML string, sets the object value, and returns the decoded value.
Since 0.01
0.01
# given: synopsis; my $decode = $yaml->decode("codename: ['Ready','Robot']\nstable: true"); # { codename => ["Ready", "Robot"], stable => 1 }
encode() (Str)
The encode method encodes the objects value as a YAML string and returns the encoded string.
# given: synopsis; my $encode = $yaml->encode; # "---\nname:\n- Ready\n- Robot\nstable: true\nversion: 0.12\n"
To install Venus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Venus
CPAN shell
perl -MCPAN -e shell install Venus
For more information on module installation, please visit the detailed CPAN module installation guide.