borisdaeppen/EBook--MOBI — pull request #14 by garu (2012-08-15 17:37:14+00:00)
Title: Book as variable

This patch is meant to address (though not entirely) issue #6. It provides a new Data() method for EBook::MOBI::MobiPerl::Palm::PDB, that returns the binary data itself instead of writing it to a file.

As a result, Write() becomes a simple convenience wrapper for Data(), writing to a file. There should be no backward compatibility issues, but it will let you provide front-end API calls in EBook::MOBI that will return the data instead of writing it to a file, which could be useful for web services and whatnot.

WARNING: There is a tradeoff in that it will need to store the entire PDB in memory before writing it to disk. If this is a problem then I suggest not taking this patch.

WARNING #2: Except for "perl -c", this was all blind-coding. I'm having trouble installing some of the prereqs on my system so I can't run the test suite.

Hope this helps. Cheers!