CGI::Application::Plugin::YAML - YAML methods for CGI::App
Just a little wrapper. Useful to add YAML methods to you CGI::App object. The whole YAML module is lazy loaded, so all that gets loaded at first is this little wrapper.
use CGI::Application::Plugin::YAML qw( :std );
$self->YAML->Load( $yamldata );
$self->YAML->Dump( $perldata );
The methods LoadFile and DumpFile can also be imported. You need to specify :max on your use.
use CGI::Application::Plugin::YAML qw( :all );
Load YAML file:-
$self->YAML->LoadFile( $yamldata );
Dump YAML file:-
$self->YAML->DumpFile( $perldata );
This module is a wrapper around
YAML::Any. It uses YAML::Any so looks for the best YAML module your system has to offer. There are Pure Perl YAML modules (such as YAML::Old) that you can easily package with your app. If like me you didn't like the idea of having functions called Dump and Load imported to your namespace, then I'd use this wapper.
This is the object that gets exported. See "SYNOPSIS"
Only an object called YAML is exported. The export groups allow you to choose what methods that object contains.
Dump Load DumpFile LoadFile
Load as functions are far to ambiguous for my liking. This also making inheritance on the YAML methods a lot easier.
Bristol and Bath Perl moungers is renowned for being the friendliest Perl group in the world. You don't have to be from the UK to join, everyone is welcome on the list:- http://perl.bristolbath.org
Lyle Hopkins ;)