Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Module advice: when is it too insignificant to release?

by ff (Hermit)
on Nov 24, 2004 at 13:41 UTC ( #410132=note: print w/replies, xml ) Need Help??

in reply to Module advice: when is it too insignificant to release?

Thank you. I believe I've gone looking for easy/fast code which dumps to '.doc' format and been disappointed. I've used what I've found to great effect, but your offering appears to be a straightforward way to dump text to '.doc'.

A couple minor things "got" me in playing with your sample:

1. The package seemed to need a line saying use Win::OLE;
2. I thought the file would land in the current directory but instead it landed in "My Documents". No big deal for me to put an absolute path name like "C:\\mydocument2.doc"
3. I'm confused about SaveAs: it's calling a different SaveAs routine, isn't it, and so might your method stand having a different name?

As to how to name it WHEN you upload it, I like the "general to specific" approach previously mentioned.

  • Comment on Re: Module advice: when is it too insignificant to release?

Replies are listed 'Best First'.
Re^2: Module advice: when is it too insignificant to release?
by jplindstrom (Monsignor) on Nov 24, 2004 at 14:42 UTC
    Re: 1. and 2. Those are things that are actually in my script, but I lost them while copying the module to the node text. Especially the absolute file name thing. This piece of code:

    my $fileModule = cwd() . "\\$module.doc";

    is is something I should move into the module, so thanks for pointing that out!

    Re: 3. The SaveAs() method delegates it's implementation to the Word Document object, so I think it's okay to name it that way. Or maybe I don't understand your point why it could be better named.


      My preference is to have names that are unique as a way of preventing confusion. If you call your method SaveAs, and your module invokes a method by the very same name from another module, then at maintenance time I have to be smart enough to know that the good old SaveAs from Win::OLE is not what the code is referring to. In other words, since another module already uses the term SaveAs, can't the method within your module have a slightly different name?

      And on the note that it's nice to have unique terms for new pieces of software: I see that WordWriter is actually a commercial package written in Java for creating Word documents and also that Ken Tomiak uses perl2word as the name of a sample Word document maker (Win32::ole and MSWord). However, I don't see any hits by google for pl2word and so perhaps this could be the name for your module. Although the letter l looks a lot like the number 1....

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://410132]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2021-09-20 08:48 GMT
Find Nodes?
    Voting Booth?

    No recent polls found