Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: What is the difference between a Statement and an Expression?

by JavaFan (Canon)
on Mar 02, 2012 at 01:25 UTC ( [id://957359]=note: print w/replies, xml ) Need Help??


in reply to Re: What is the difference between a Statement and an Expression?
in thread What is the difference between a Statement and an Expression?

A statement (in perl) is anything that is ended with a ";" while an expression is the part of a statement that actually does something like a mathematical computation, or the assigning of a value etc.
So, in
for (my $i = 0; $i < 10; $i++) { print "\$i = "; print $i }
there are three statements, my $i = 0;, $i < 10; and print "\$i = ";, but print $i isn't, and neither is the entire for construct?

Curious.

Log In?
Username:
Password:

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

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

    No recent polls found