Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: creating a perl entry-point

by boftx (Deacon)
on Jan 03, 2014 at 17:39 UTC ( #1069180=note: print w/ replies, xml ) Need Help??


in reply to creating a perl entry-point

roboticus has good points. I would add the following only as an additional consideration:

use strict; use warnings; main(); # always have an exit from a script, it will save you grief! exit; sub main { ... # do some really cool stuff here # always have a known return value, just falling off the end WILL +bite # bite you someday. return; } __END__

The use of exit and __END__ can prevent unexpected additions to your script for one reason or another. It is also handy to have all your POD (you do document your code, right?) after the __END__ statement.

It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.


Comment on Re: creating a perl entry-point
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2015-07-07 07:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls