---
title: "Interestingly enough, since subroutine declarations can come anywhere… — Larry Wall Quote #299 | QuotesBy.net"
description: "Interestingly enough, since subroutine declarations can come anywhere, you wouldn't have to put BEGIN {} at the beginning, nor END {} at the end. Int… — a quote by Larry Wall."
image: "https://quotesby.net/wp-content/themes/quotesby-editorial/assets/og-default.png"
---

> # Interestingly enough, since subroutine declarations can come anywhere, you wouldn't have to put BEGIN {} at the beginning, nor END {} at the end. Interesting, no? I wonder if Henry would like it. :-)

[Larry Wall](https://quotesby.net/Larry-Wall)\#299

[Programming](https://quotesby.net/Larry-Wall/programming/)[Perl](https://quotesby.net/Larry-Wall/perl/)[Syntax](https://quotesby.net/Larry-Wall/syntax/)[Flexibility](https://quotesby.net/Larry-Wall/flexibility/)

[WhatsApp (opens in a new tab)](https://wa.me/?text=%E2%80%9CInterestingly%20enough%2C%20since%20subroutine%20declarations%20can%20come%20anywhere%2C%20you%20wouldn%27t%20have%20to%20put%20BEGIN%20%7B%7D%20at%20the%20beginning%2C%20nor%20END%20%7B%7D%20at%20the%20end.%20Interesting%2C%20no%3F%20I%20wonder%20if%20Henry%20would%20like%20it.%20%3A-%29%E2%80%9D%20%E2%80%94%20Larry%20Wall%20https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F299%2F)[X (opens in a new tab)](https://twitter.com/intent/tweet?text=%E2%80%9CInterestingly%20enough%2C%20since%20subroutine%20declarations%20can%20come%20anywhere%2C%20you%20wouldn%27t%20have%20to%20put%20BEGIN%20%7B%7D%20at%20the%20beginning%2C%20nor%20END%20%7B%7D%20at%20the%20end.%20Interesting%2C%20no%3F%20I%20wonder%20if%20Henry%20would%20like%20it.%20%3A-%29%E2%80%9D%20%E2%80%94%20Larry%20Wall&url=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F299%2F)[Facebook (opens in a new tab)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F299%2F)

## About this quote

What does it mean?The speaker notes that because subroutines can be declared anywhere, BEGIN/END blocks aren’t strictly needed, and wonders humorously about Henry’s opinion.In plain termsYou could skip BEGIN/END blocks since subroutines can appear anywhere.What can you take from it?Use language flexibility to simplify code structure.

### Where it applies

- script writing
- module development

### Putting it to work

- remove unnecessary boilerplate
- leverage language features

### Questions to consider

- When are explicit blocks still beneficial?
- How does this affect readability?

### Another view

The comment is playful and may overlook cases where BEGIN/END are useful.

## More from Larry Wall

1. > I might be able to shoehorn a reference count in on top of the numeric value by disallowing multiple references on scalars with a numeric value, but it wouldn'…

[Permalink to quote \#298](https://quotesby.net/Larry-Wall/298/ "Permalink to quote 298")
2. > It is easier to port a shell than a shell script.

[Permalink to quote \#300](https://quotesby.net/Larry-Wall/300/ "Permalink to quote 300")
3. > I'll say it again for the logic impaired.

[Permalink to quote \#297](https://quotesby.net/Larry-Wall/297/ "Permalink to quote 297")

## Related quotes

1. > Although the Perl Slogan is There's More Than One Way to Do It, I hesitate to make 10 ways to do something. :-)

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#1](https://quotesby.net/Larry-Wall/1/ "Permalink to quote 1")
2. > And don't tell me there isn't one bit of difference between null and space, because that's exactly how much difference there is. :-)

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#2](https://quotesby.net/Larry-Wall/2/ "Permalink to quote 2")
3. > We toast the Lisp programmer who pens his thoughts within nests of parentheses.

[Alan Perlis](https://quotesby.net/Alan-Perlis)[Alan Perlis quote \#2](https://quotesby.net/Alan-Perlis/2/ "Permalink to quote 2")

```json
{
    "@context": "https://schema.org",
    "@type": "Quotation",
    "text": "Interestingly enough, since subroutine declarations can come anywhere, you wouldn't have to put BEGIN {} at the beginning, nor END {} at the end. Interesting, no? I wonder if Henry would like it. :-)",
    "url": "https://quotesby.net/Larry-Wall/299/",
    "spokenByCharacter": {
        "@type": "Person",
        "name": "Larry Wall"
    }
}
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://quotesby.net/"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Authors",
            "item": "https://quotesby.net/authors/"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Larry Wall",
            "item": "https://quotesby.net/Larry-Wall"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "Quote #299",
            "item": "https://quotesby.net/Larry-Wall/299/"
        }
    ]
}
```
