Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Apparent Inconsistencies in Perl Function Naming

by chromatic (Archbishop)
on Nov 24, 2000 at 22:03 UTC ( [id://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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://43246]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-20 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found