---
title: "Magically turning people's old scalar contexts into list contexts is … — Larry Wall Quote #125 | QuotesBy.net"
description: "Magically turning people's old scalar contexts into list contexts is a recipe for several kinds of disaster. — a quote by Larry Wall."
image: "https://quotesby.net/wp-content/themes/quotesby-editorial/assets/og-default.png"
---

> # Magically turning people's old scalar contexts into list contexts is a recipe for several kinds of disaster.

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

[Programming](https://quotesby.net/Larry-Wall/programming/)[Software engineering](https://quotesby.net/Larry-Wall/software-engineering/)[Disaster](https://quotesby.net/topics/disaster/)

[WhatsApp (opens in a new tab)](https://wa.me/?text=%E2%80%9CMagically%20turning%20people%27s%20old%20scalar%20contexts%20into%20list%20contexts%20is%20a%20recipe%20for%20several%20kinds%20of%20disaster.%E2%80%9D%20%E2%80%94%20Larry%20Wall%20https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F125%2F)[X (opens in a new tab)](https://twitter.com/intent/tweet?text=%E2%80%9CMagically%20turning%20people%27s%20old%20scalar%20contexts%20into%20list%20contexts%20is%20a%20recipe%20for%20several%20kinds%20of%20disaster.%E2%80%9D%20%E2%80%94%20Larry%20Wall&url=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F125%2F)[Facebook (opens in a new tab)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F125%2F)

## About this quote

What does it mean?Automatically converting scalar values to lists can cause many problems.In plain termsChanging single values to lists often leads to disaster.What can you take from it?Avoid implicit data-type conversions that can break code.

### Where it applies

- when refactoring code
- in language design

### Putting it to work

- use explicit conversions
- test edge cases

### Questions to consider

- What safeguards can prevent such conversion errors?

### Another view

The statement is broad and lacks concrete examples.

## More from Larry Wall

1. > P.S. I suppose I really should be nicer to people today, considering I'll be singing in Billy Graham's choir tonight... :-)

[Permalink to quote \#124](https://quotesby.net/Larry-Wall/124/ "Permalink to quote 124")
2. > And we can always supply them with a program that makes identical files into links to a single file.

[Permalink to quote \#126](https://quotesby.net/Larry-Wall/126/ "Permalink to quote 126")
3. > Oh, wait, that was Randal...nevermind...

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

## Related quotes

1. > There are probably better ways to do that, but it would make the parser more complex. I do, occasionally, struggle feebly against complexity... :-)

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#23](https://quotesby.net/Larry-Wall/23/ "Permalink to quote 23")
2. > And in the limiting case where the optimizer is completely broken because it's not implemented yet, we get to work around that too. Optionally...

[Larry Wall](https://quotesby.net/Larry-Wall)[Larry Wall quote \#234](https://quotesby.net/Larry-Wall/234/ "Permalink to quote 234")
3. > Premature optimization is the root of all evil (or at least most of it) in programming.

[Donald Knuth](https://quotesby.net/Donald-Knuth)[Donald Knuth quote \#1](https://quotesby.net/Donald-Knuth/1/ "Permalink to quote 1")

```json
{
    "@context": "https://schema.org",
    "@type": "Quotation",
    "text": "Magically turning people's old scalar contexts into list contexts is a recipe for several kinds of disaster.",
    "url": "https://quotesby.net/Larry-Wall/125/",
    "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 #125",
            "item": "https://quotesby.net/Larry-Wall/125/"
        }
    ]
}
```
