1. 1; # A simple number 1
This notation is commonly used when writing modules. In order to successfully load a module at compile time, that module must return a
true value. Having a 1(a valid true value) as the last command in the module ensures that at true value will be returned.
2. exit; # The exit command
I use exit mostly during testing and development. Otherwise I'd rather use another way to bail out of my script if processing is finished. Using exit could be better for all I know, since an exit is sure to do just that.
3. goto BOTTOM; # goto a label at the end of the script
From what I understand goto's can create instability in the scripts. I don't think I've ever seen them used in anything outside of obfu.
4. &footer; # Nothing, just the end of the script
This is the one I most often use, unless I'm working with objects in which case I call the appropriate destructors before letting the program end.
Ex.
$sth->finish();
$dbh->disconnect();
Amel
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.