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. :-)
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 terms
- You 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
Putting it to work
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
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 It is easier to port a shell than a shell script.
Permalink to quote #300 I'll say it again for the logic impaired.
Permalink to quote #297
Related quotes
Although the Perl Slogan is There's More Than One Way to Do It, I hesitate to make 10 ways to do something. :-)
Larry WallLarry Wall quote #1 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 WallLarry Wall quote #2 We toast the Lisp programmer who pens his thoughts within nests of parentheses.
Alan PerlisAlan Perlis quote #2