Re: Logical OR AND
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 5 Mar 2007 03:54:34 -0800
On Mar 5, 12:44 am, worlman...@xxxxxxxxx wrote:
for the perl statement
$denominator !=0 || ( print "cannot divde 0\n" and next);
I don't recall Java has the similar thing like above, am I right?
Why are you asking a Perl group? Ask a Java group what you can do in
Java.
the above - 2nd part execute only of 1st part is False
you can use logical operator like this?
Yes, obviously you can, since it doesn't give an error.
in Java anything similar??
Again, ask a Java group, not a Perl group.
unless ( $denominator !=0 ){
( print "cannot divde 0\n" and (print "aaa") and next);
}
in perl you can execute several statement in 1 line like above?
( print "cannot divde 0\n" and (print "aaa") and next);
in Java i don't seem to know i can use like above right?
Why all Print statement will evaluate to True ?
The print function is documented in `perldoc -f print`. You should
read it. It explains what the return value of print() is.
Paul Lalli
.
- References:
- Logical OR AND
- From: worlman385
- Logical OR AND
- Prev by Date: Re: boolean expression
- Next by Date: Simple string substitution
- Previous by thread: Logical OR AND
- Next by thread: boolean expression
- Index(es):
Relevant Pages
|