---
title: "Remember though that THERE IS NO GENERAL RULE FOR CONVERTING A LIST I… — Larry Wall Quote #273 | QuotesBy.net"
description: "Remember though that THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR. — a quote by Larry Wall."
image: "https://quotesby.net/wp-content/themes/quotesby-editorial/assets/og-default.png"
---

> # Remember though that THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR.

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

[Programming](https://quotesby.net/Larry-Wall/programming/)[Perl](https://quotesby.net/Larry-Wall/perl/)[Data](https://quotesby.net/topics/data/)

[WhatsApp (opens in a new tab)](https://wa.me/?text=%E2%80%9CRemember%20though%20that%20THERE%20IS%20NO%20GENERAL%20RULE%20FOR%20CONVERTING%20A%20LIST%20INTO%20A%20SCALAR.%E2%80%9D%20%E2%80%94%20Larry%20Wall%20https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F273%2F)[X (opens in a new tab)](https://twitter.com/intent/tweet?text=%E2%80%9CRemember%20though%20that%20THERE%20IS%20NO%20GENERAL%20RULE%20FOR%20CONVERTING%20A%20LIST%20INTO%20A%20SCALAR.%E2%80%9D%20%E2%80%94%20Larry%20Wall&url=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F273%2F)[Facebook (opens in a new tab)](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fquotesby.net%2FLarry-Wall%2F273%2F)

## About this quote

What does it mean?There is no universal method to turn a list into a single value.In plain termsYou can't always convert a list to a scalar the same way.What can you take from it?Choose the conversion method that fits the specific data.

### Where it applies

- writing a function
- data processing

### Putting it to work

- select appropriate algorithm
- document assumptions

### Questions to consider

- When is it appropriate to reduce a collection to a single item?

### Another view

Sometimes a list cannot be meaningfully reduced to one value.

## More from Larry Wall

1. > Perl is designed to give you several ways to do anything, so consider picking the most readable one.

[Permalink to quote \#272](https://quotesby.net/Larry-Wall/272/ "Permalink to quote 272")
2. > The autodecrement is not magical.

[Permalink to quote \#274](https://quotesby.net/Larry-Wall/274/ "Permalink to quote 274")
3. > Okay, that's definitely enough hype.

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

## 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. > I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad …

[Linus Torvalds](https://quotesby.net/Linus-Torvalds)[Linus Torvalds quote \#49](https://quotesby.net/Linus-Torvalds/49/ "Permalink to quote 49")

```json
{
    "@context": "https://schema.org",
    "@type": "Quotation",
    "text": "Remember though that THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR.",
    "url": "https://quotesby.net/Larry-Wall/273/",
    "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 #273",
            "item": "https://quotesby.net/Larry-Wall/273/"
        }
    ]
}
```
