Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Main routines, unit tests, and sugar

by perlfan (Curate)
on Jun 19, 2013 at 15:47 UTC ( #1039795=note: print w/replies, xml ) Need Help??

in reply to Main routines, unit tests, and sugar

Personally, I really like brian's modulino approach, but I use it sparingly.

Main methods are one of the things that LPW wanted to do away with, or make implied (as many other things are).

Yes, the main() or however you do it will make it more familiar with those comfortable with compiled languages. However, it's not really useful unless you're going to be taking advantage of it for things like unit testing.

Where brian's modulino approach shines for me are situations where I am writing a utility that generating a useful set of subroutines for a related set of utilities. With the modulino, I get the ability to run it as a utility or include it as a library in a related util. I get to create unit tests as well.

So, I would highly recommend that approach in these situations, rather than just arbitrarily creating a main() method.

  • Comment on Re: Main routines, unit tests, and sugar

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039795]
[hippo]: Loudest gig I can recall was Wolfsbane at the Astoria in the early 90s. Head rang for about 3 days afterwards. They were top, though.
[johngg]: My ears are still ringing!
Discipulus was outside The Clash concert in 1985..
[marto]: Wolfsbane , now I'm having flashbacks
[choroba]: Isn't Using PerlPod Creatively rather a meditation?
[choroba]: I don't see a question

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-03-24 12:10 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (301 votes). Check out past polls.