Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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]
[Corion]: Hi marto, Discipulus, choroba!
[Corion]: Seems like I chose just the right day to do a half-day recovery yesterday. Today it's snowing again, instead of the sun shining, so that's a good day to be at the office again ;)
[Discipulus]: good morning folks!
[choroba]: Boasting: brian d foy tweeting my blogpost!
[Discipulus]: eh eh choroba print it on a t-shirt for the next yapc.. ;=)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2018-03-22 09:17 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (273 votes). Check out past polls.