John Constable > Mozilla-Mork > Mozilla::Mork

Download:
Mozilla-Mork-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Mozilla::Mork - Perl extension for reading Mork hash database file such as are used in the Mozilla Address Book and History files.

SYNOPSIS ^

        use Mozilla::Mork;
        $file = $ARGV[0];
        unless ($file) { die "Useage: $0 <filename>\n"; }
        #get a reference to an array of hash's
        my $MorkDetails = Mozilla::Mork->new($file);
        my $results = $MorkDetails->ReturnReferenceStructure();
        #process those results
        # for each line in the database
        my %array = %{ $results->[0] };
        my @field_names = sort(keys(%array));
        #my @field_names = $MorkDetails->ListHeaders();
        map { print "Field Names: $_\n"; } @field_names;
        print "\ndone!\n";

DESCRIPTION ^

New

Sets up the OO stuff. Returns a pointer to a data structure, loads the mork database into a in-memory hash (array of hashes of hashes, actually.)

ReturnReferenceStructure

Returns the reference to the array containing the hash's of the data. Each element in the array is a seperate record in the 'database'. The record headers are usually the first record (see ListHeaders() below).

ListHeaders

Dumps the record headers. returns an array of the record headers. It assumes that the first record contains all the headers. So far this assumption has proved true..

EXPORT

None by default.

SEE ALSO ^

I'll probably put up a web page here eventually: http://www.kript.net

For now, see;

http://www.jwz.org/hacks/mork.pl http://www.mozilla.org/mailnews/arch/mork/primer.txt http://jwz.livejournal.com/312657.html http://www.jwz.org/doc/mailsum.html http://bugzilla.mozilla.org/show_bug.cgi?id=241438

I would recommend reading the source of the perl script first in the list above. This module was taken from work Jamie Zawinski did in that script, so a huge thanks - I admit I might not have tackled this without this as a starting point! Jamie has quite a lot to say about the Mork file format, and its worth reading. That I know of, this is only the second module to get involved with Mork, and we're both based on Jamie's code..

My employers website: http://www.ipaccess.com. My thanks to them for allowing me to work on this and release it as open source.

AUTHOR ^

John Constable, <john@kript.net>

However, this could not be possible without Jamie Zawinski (and others) initial mozilla history perl parsing script (see above).

COPYRIGHT AND LICENSE ^

Copyright (C) 2005 by John Constable

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: