in reply to Re: Re: unless....else
in thread unless....else
Anyhow the reason WHAT?!!! is printed is not because neither of the unless conditions were false (and hence executed), but because the second statement's condition (i.e. unless( 2 ){ .. } ), was true (and not executed), and thus the else that follows is executed. For example:
use strict; use warnings; my $foo = 1; my $bar = 2; my $baz = 3; unless ( $foo == $bar ) { print "TEST 1\n"} unless ( $foo != $baz ) { print "TEST 2\n" } else { print "TEST 3\n"}
-enlil
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: unless....else
by LanceDeeply (Chaplain) on Aug 06, 2003 at 03:38 UTC |