I've written modules for my own use, but I'm making the leap to something publicly available on CPAN. This brings a lot more complexity and responsibility, so I'd appreciate some advice.
Ultimately, this code will a)take a specially formatted input file and break pieces of it out to separate files and b) offer a reverse function to bundle many text files into one.1 For this discussion, just think of tar/untar and you'll basically be right on track.
Now, the question:
I'm planning on offering a pair of command-line scripts with my module in addition to the callable module. (Much like /usr/bin/module-starter that comes with Module::Starter .) However, when people call my routines from perl, I don't really want to do any real I/O. It seems like that's over zealous, and frankly, I don't want the responsibility of opening and writing to someone else's filesystem.
So, given that I'm passed an input filename and an output directory name, should I:
- open the neccessary files and write to them, assuming the caller knows what he's doing
- return a hashref with output names as keys, and file contents as data values (caller can write them out himself)
- something else?
Technically, I'm working on replicas of IEBUPDTE and IEBPTPCH. They are utilities to let me work with mainframe PDS members locally. This is OS/390, z/OS stuff.