Skip to content
quotesby

About this quote

What does it mean?
There is no universal method to turn a list into a single value.
In plain terms
You 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
  2. The autodecrement is not magical.

    Permalink to quote #274
  3. Okay, that's definitely enough hype.

    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 WallLarry Wall 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 WallLarry Wall 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 TorvaldsLinus Torvalds quote #49