Remember though that THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR.
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
Putting it to work
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
Perl is designed to give you several ways to do anything, so consider picking the most readable one.
Permalink to quote #272 The autodecrement is not magical.
Permalink to quote #274 Okay, that's definitely enough hype.
Permalink to quote #271
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 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