Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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. In reply to Re: Apparent Inconsistencies in Perl Function Naming
by chromatic
|
|