Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$a1=2;
$b1=10;
(defined($a1 > $b1)) ? ($int = ($a1/$b1)) : ($int = ($b1/$a1));
print $int;
wats wrong with this code?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ternary operator
by tmharish (Friar) on Jan 18, 2013 at 06:55 UTC | |
by frozenwithjoy (Priest) on Jan 18, 2013 at 08:55 UTC | |
Re: ternary operator
by davido (Cardinal) on Jan 18, 2013 at 06:54 UTC | |
Re: ternary operator
by BrowserUk (Patriarch) on Jan 18, 2013 at 06:44 UTC | |
Re: ternary operator
by AnomalousMonk (Archbishop) on Jan 18, 2013 at 09:39 UTC |
Back to
Seekers of Perl Wisdom