Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6165833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:14:06+00:00 2026-05-23T22:14:06+00:00

A few years back, I have adopted the following pattern for all except the

  • 0

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)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:14:07+00:00Added an answer on May 23, 2026 at 10:14 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting back into a bit more .NET after a few-years of not
A few years ago I have worked on a green field project where we
I wrote a nice ARM assembler routine a few years back and it has
We have a Java/Swing client that's been around for quite a few years. When
A few years back, another clever programmer set up a VB.NET service to print
I discovered ASP.NET profiles a few years back and found it quick and easy
First, a warning, I have come back from a years break of html/css and
A few years ago, I read a book that described how you could override
A few years ago we started playing around with XForms from the W3C for
A few years ago I developed a web app for which we wanted to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.