Data::Plist::Writer - Object serializer and abstact superclass for BinaryWriter and XMLWriter
# Create new my $write = Data::Plist::BinaryWriter->new; # Writing to a string ($ret is binary output) my $ret = $write->write($data); # Writing to a file C<$filename> $ret = $write->write($filename, $data);
Data::Plist::Writer is the abstract superclass of Data::Plist::BinaryWriter and Data::Plist::XMLWriter. It takes perl data structures, serializes them (see "SERIALIZED DATA" in Data::Plist), and recursively writes to a given filehandle in the desired format.
Data::Plist::Writer
Creates a new writer. 'serialize' is set to 1 since it's assumed that data being passed in will be perl data structures that need to be serialized. Users may set it to 0 when creating a writer if they wish to use preserialized data.
Takes a perl data structure $data and writes to the given filehandle $filehandle, or filename $filename. If only the $data is provided, returns the data to be written, as a string.
$data
$filehandle
$filename
Takes a serialized object $data (see "SERIALIZED DATA" in Data::Plist) and rewrites it as a keyed archive (see "KEYED ARCHIVES" in Data::Plist) by folding on UIDs.
Takes a perl data structure $data and turns it into a series of nested arrays of the format [datatype => data] (see "SERIALIZED DATA" in Data::Plist) in preparation for writing. This is an internal data structure that should be immediately handed off to a writer.
Takes a data structure $data and determines what sort of serialization it should go through.
Objects wishing to provide their own serializations should have a 'serialize' method, which should return something in the internal structure mentioned above (see also "SERIALIZED DATA" in Data::Plist).
To install Data::Plist, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Plist
CPAN shell
perl -MCPAN -e shell install Data::Plist
For more information on module installation, please visit the detailed CPAN module installation guide.