G'day jinnicky,
The module you'll want for that is
OpenOffice::OODoc::Meta.
I haven't previously used this.
I did install OpenOffice::OODoc some time ago and the
OpenOffice::OODoc::Meta, along with other OpenOffice::OODoc::* modules, appear to be bundled with this (see OpenOffice-OODoc distribution details).
So, if you have OpenOffice::OODoc, you probably also have the related modules.
The documentation looks good and usage seems straightforward.
I created a very basic text document for testing (pm_1156099_test.odt) and added a title ("PM 1156099 Test Document") via the Properties menu item.
I then created this test script:
#!/usr/bin/env perl -l
use strict;
use warnings;
use OpenOffice::OODoc::Meta;
my $meta = OpenOffice::OODoc::Meta::->new(file => 'pm_1156099_test.odt
+');
print 'Author: ', $meta->creator();
print 'Title: ', $meta->title();
print 'Created: ', $meta->date();
This produced this output:
Author: Ken Cotterill
Title: PM 1156099 Test Document
Created: 2016-02-25T15:23:56
There's lots of other metadata you can access if you want.
[I do recall hearing something about OpenOffice::OODoc being superceded by ODF::lpOD. Both sets of modules are by the same author, Jean-Marie Gouarné, and the ODF::lpOD distribution is more recent. I looked around for some definitive information on this but was unsuccessful, so that remains unconfirmed: perhaps another monk can provide something more substantial on this matter.]
|