Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Production level script template

by tomhukins (Curate)
on Sep 07, 2005 at 15:58 UTC ( #489908=note: print w/ replies, xml ) Need Help??


in reply to Production level script template

I would deal with quite this differently to you. For example:

  • Write your documentation in POD, not as comments. That way you can run perldoc scriptname to see the purpose, requirements, etc.
  • Put your global variables such as $cmdname and $thread in a singleton object. That means if someone happens to use a local variable called $thread your code won't break.
  • Put all the code in a separate module, or at least a file that you can require. This makes your scripts more readable because you don't have to wade through the common code in each separate script. If you find a bug, you only have to change it once.
  • Consider using modules such as Log::Log4perl and Email::Send to replace your home-grown equivalents. Less code means less bugs.


Comment on Re: Production level script template
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-11-27 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (177 votes), past polls