Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Apparent Inconsistencies in Perl Function Naming

by chromatic (Archbishop)
on Nov 24, 2000 at 22:03 UTC ( #43246=note: print w/replies, xml ) Need Help??

in reply to Apparent Inconsistencies in Perl Function Naming

A list is different from a scalar.
A list is different from a scalar.

(I had to repeat that to myself many times when first learning Perl.)

I don't see length as cut and dried as you do. It's easy to say, "What's the length of that piece of lumber?" and people understand what you mean. That's unambiguous. It's harder to say "What's the length of that pile of lumber over there?" and get a good answer.

Do you mean, "Please measure the base of the pile?" or "How long is the average piece of wood?" or "What's the expiration date?"

Perl goes to great lengths (pardon the pun) to express the differences between a thing and a pile of stuff. Unlike C, a string-in-a-scalar isn't the same as an array of characters. It's something fundamental to the language. You can chop it up in little pieces. You can build a birdhouse out of it. You can whack someone in the head with it for not using strict.

I'm not going to say that everything in Perl is 100% okay yes sir perfect, but I will say that once you understand context, things make a lot more sense.

  • Comment on Re: Apparent Inconsistencies in Perl Function Naming

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://43246]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2018-05-24 00:44 GMT
Find Nodes?
    Voting Booth?