File::Sticker::Reader::YamlPrefix - read and standardize meta-data from YAML-prefixed text file
version 3.0101
use File::Sticker::Reader::YamlPrefix; my $obj = File::Sticker::Reader::YamlPrefix->new(%args); my %meta = $obj->read_meta($filename);
This will read meta-data from plain text files where the first part of the file contains YAML data, set up as if it is a YAML stream. That is, the file starts with '---' on one line, then there is YAML data, then there is another '---' line, and all content after that is ignored. Then it will standardize it to a common nomenclature, such as "tags" for things called tags, or Keywords or Subject etc.
This format can be useful as a way of storing meta-data in documents or in wiki pages.
Used for debugging info
The priority of this reader. Readers with higher priority get tried first.
If this reader can be used for the given file, then this returns true. File must be plain text and NOT end with '.yml'
Returns the fields which this reader knows about. This reader has no limitations.
my $known_fields = $reader->known_fields();
Read the meta-data from the given file.
my $meta = $obj->read_meta($filename);
Private interface, just this file
The file has YAML if the FIRST line is '---'
Get the YAML part of the file (if any) by reading the stuff between the first set of --- lines and also the rest of the file as a separate part.
Please report any bugs or feature requests to the author.
To install File::Sticker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Sticker
CPAN shell
perl -MCPAN -e shell install File::Sticker
For more information on module installation, please visit the detailed CPAN module installation guide.