|Think about Loose Coupling|
Module advice: when is it too insignificant to release?by jplindstrom (Monsignor)
|on Nov 23, 2004 at 19:44 UTC||Need Help??|
jplindstrom has asked for the
wisdom of the Perl Monks concerning the following question:
The problem: SQL tables and procedures are documented in the source code and now we want to include a subset of them in a written introduction/tutorial. Copying the text into the Word document is bound to make them go out of sync. And it's boring...
The solution: A little script to extract the documentation and write it to small Word files, grouped by sub system. These word files are then linked into the main document, so they can be re-generated independently from the main document.
Making it happen: At first I thought RTF would be the right choice for this , but that just ended up being messy, and I didn't have time to get to know the RTF format. So I turned to automating Word instead. Surprisingly, I couldn't find a simple wrapper around the Win32::OLE module, so I hacked something together using example code from the Net.
The code: Now I have an extremely simplistic module that does the not-so-heavy lifting. This is basically it:
I can use it like so:
The new problem: What do I do with this code?
It solves an actual problem, but the problem wasn't very difficult to solve. So it hardly does anything while being very useful in my little script. Is it useful enough to merit a CPAN upload (after adding POD and tests obviously)?
If it is, what namespace should I use? Hogging the namespace for this puny module seems almost rude. While Word::Document::Writer::Simple is an option, most other *::Simple modules are supposed to be simple to use, and a more proper name would be Word::Document::Writer::Simplistic :) But that sounds ridiculous.
So, rude or ridiculous? Or something completely different?