Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to properly use modules?

by Happy-the-monk (Monsignor)
on Apr 21, 2012 at 06:12 UTC ( #966311=note: print w/ replies, xml ) Need Help??


in reply to How to properly use modules?

Isn't it a good thing to have all the code in one place

Yes, it actually is a programmer's motto: "don't repeat yourself".

Cheers, Sören


Comment on Re: How to properly use modules?
Re^2: How to properly use modules?
by Anonymous Monk on Apr 21, 2012 at 06:53 UTC

    Actually no :) DRY says make subroutines/modules, not put it all in one file

    Sure, you could turn four scripts into one module, or you could turn them into four modules, it all depends on how much they share

Re^2: How to properly use modules?
by tercoz (Acolyte) on Apr 21, 2012 at 09:59 UTC
    Yes repeating is not good, indeed. I just wanted to do some tests with Test::More module and got into a problem, my module is too small and do not cover everything I'd like to test, because most of important subroutines are in the .pl files, how to write tests for those - dunno...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-08-22 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (147 votes), past polls