Net::FCP::Metadata - metadata utility class.
use Net::FCP::Metadata;
Creates a new metadata Object from the given string or reference. The object is overloaded and will stringify into the corresponding string form (which might be slightly different than the string it was created from).
If no arguments is given, creates a new metadata object with just a version part.
version
The object is implemented as a hash reference. See parse_metadata, below, for info on it's structure.
parse_metadata
Returns the string form of the metadata data.
Add a simple redirection to the document section to the given target. All extra arguments will be added to the info subsection and often contains description and format fields.
document
info
description
format
Internal utility function, do not use directly!
Parse a metadata string and return it.
The metadata will be a hashref with key version (containing the mandatory version header entries) and key raw containing the original metadata string.
raw
All other headers are represented by arrayrefs (they can be repeated).
Since this description is confusing, here is a rather verbose example of a parsed manifest:
( raw => "Version...", version => { revision => 1 }, document => [ { info => { format" => "image/jpeg" }, name => "background.jpg", redirect => { target => "freenet:CHK\@ZcagI,ra726bSw" }, }, { info => { format" => "text/html" }, name => ".next", redirect => { target => "freenet:SSK\@ilUPAgM/TFEE/3" }, }, { info => { format" => "text/html" }, redirect => { target => "freenet:CHK\@8M8Po8ucwI,8xA" }, } ] )
Takes a hash reference as returned by Net::FCP::parse_metadata and returns the corresponding string form. If a string is given, it's returned as is.
Net::FCP::parse_metadata
Net::FCP.
Not heavily tested.
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/
To install Net::FCP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::FCP
CPAN shell
perl -MCPAN -e shell install Net::FCP
For more information on module installation, please visit the detailed CPAN module installation guide.