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


        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";



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.)


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).


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..


None by default.


I'll probably put up a web page here eventually:

For now, see;

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: My thanks to them for allowing me to work on this and release it as open source.


John Constable, <>

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


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.