Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Should Modules Do I/O?

by scmason (Monk)
on Mar 18, 2005 at 16:30 UTC ( [id://440734]=note: print w/replies, xml ) Need Help??


in reply to Should Modules Do I/O?

I think that you should offer both. If you know what you are doing, then make it so. If the user trusts you, they will let you write. If they do not trust you, they will write it themselves.

Passing the data (or references to it) around can cause more lines of code, more chances for error and confusion. Also, if your module is supposed to handle this data, then the user expects you will handle it. What would you think of tar if it only untarred the archive in memory and then gave you memory references? It would be less usefull.

Of course, you want to provide references to the data, so that the user could manipulate it before writing it to disk.

This is my humble opinion. Hope that it helps.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 21:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found