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

Re: How to properly use modules?

by Happy-the-monk (Canon)
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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://966311]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2018-05-25 21:15 GMT
Find Nodes?
    Voting Booth?