Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Should Modules Do I/O?by BrowserUk (Patriarch) |
on Mar 18, 2005 at 18:07 UTC ( [id://440760]=note: print w/replies, xml ) | Need Help?? |
I think you asked a very good question and are thinking along the right lines. As counterpoint to other responses, I hate modules that insist on writing stuff to disk, and force me to re-open the output file* in order to get the data back into my program. Maybe
So, I'd infinitely prefer an interface that allowed me to supply an open filehandle for the archive file (new or existing), and methods for adding and retrieving files from the archive: Reading
Writing
Providing that kind of flexibility for the users, combined with the reduction in code in your module, would make your module more powerful and useful. Especially as you're providing 'arcit.pl' and 'unarcit.pl' scripts for the simple case, thereby avoiding the "boilerplate code" charge. (*usually after patching the module to provide a way of finding out the filename) Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?
In Section
Seekers of Perl Wisdom
|
|