Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Comma's and blocks

by oha (Friar)
on Oct 04, 2007 at 10:24 UTC ( [id://642621]=note: print w/replies, xml ) Need Help??


in reply to Comma's and blocks

that's not so strange in computer languages, in C:
if (COND) BLOCK
as you can see, there are no commas and if BLOCK is surrounded by {} you can avoid the semicolon, too.
Same applies to for, while.

The only difference between those languages and perl1 is that perl allow more freedom: in some cases you can avoid (), there are more tokens which means the same (for, foreach), and the same token may have more available syntaxes (if (COND) { BLOCK },  EXPR if COND;) and so on. Probably Wirth would not like it, but i don't like pascal, so... :)

Oha

1 - The OP didn't compared perl to other langs, but i hope this diversion can be partially OT.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-18 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found