The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

FileMetadata::Miner::Ext

SYNOPSIS

  my $miner = FileMetadata::Miner::Ext->new ({});

  my $meta = {};

  $miner->mine ('path', $meta);

  foreach (keys %{$meta}) {

    print "$_ = $meta->{$_}", "\n";

  }

DESCRIPTION

This module allows meta data for a file to be described using another file written in a specific XML format. The file with the meta data should only differ from the file it describes by a suffix.

The XML is as described below.

  <meta-data>

    <Title>My document</Title>

    <description>Here is a description</description>

  </meta-data>

The root element can contain any number of elements which form the basis for keys in the meta hash. The text that these elements enclose foms the value. The above document would result in the following keys to be inserted into the meta hash.

FileMetadata::Miner::Ext::Title => 'My document'

FileMetadata::Miner::Ext::description => 'Here is a description'

METHODS

new

See "new" in FileMetadata::Miner

The new method accpets a single key 'config' in the config hash. This suffix is appended to any given file path. The resulting file is expected to be in the XML format described above. The default suffix is '.ext'. The config hash can be constructed as follows:

  {

    suffix => '.ext'

  }

mine

See "mine" in FileMetadata::Miner

The mine method inserts keys into the meta hash as described in the "desc". This method always returns a true value. Failures to open the suffixed file are not considered as a failure to miner data. It is considered that this data is not available.

VERSION

0.1 - This is the first release

REQUIRES

XML::Simple

AUTHOR

Midh Mulpuri midh@enjine.com

LICENSE

This software can be used under the terms of any Open Source Initiative approved license. A list of these licenses are available at the OSI site - http://www.opensource.org/licenses/