A few years back, I have adopted the following "pattern" for all except the most simple of my Perl scripts: (I don't even remember where I saw it first, it certainly wasn't my genuine idea.)
use strict;
...
sub main {
...
}
... possibly more subs ...
... at the end of the file:
#############
# Call main #
&main();
#############
Is there any benefit to this? I find the code a little cleaner, but otherwise I'm not sure this has any purpose other that to make the C programmer in me happy :-)
Any insights from Perl experts and power users appreciated. (I am certainly neither)
Definition of submain : a main (as in a sewer, gas, electrical, or drainage system) having a number of lesser mains feeding into or branching from it but being itself subsidiary to a larger main.
A sub-main electrical circuit can be defined as a circuit connected directly from the main LV switchboard to a sub-main distribution panel or a rising main for final connection of the minor current-using equipment.
Sub main distribution boards are also referred to as MCCB panels. A typical SMDB is equipped with MCCBs as incomer and MCCBs as outgoings. MCCB incomer is connected to upstream Main Distribution Board whereas MCCB outgoings are connected to downstream loads. These MCCBs wall mount with user friendly arrangements.
It's a known idiom to limit scope. This is discussed in https://stackoverflow.com/q/1183876#comment-1012787 ff. and http://use.perl.org/comments.pl?sid=43991&cid=70918 ff.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With