in reply to ternary operator ?
See the Conditional Operator section in the perlop manpage for more details.my $foo = "test"; print +( $foo =~ /^\w+\z/ ? "condition true" : "condition false" ),$/; my $bar = defined $x ? $x : "nought"; print "\$bar is: $bar", $/; __output__ condition true $bar is: nought
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ternary operator ?
by Abigail-II (Bishop) on Nov 29, 2002 at 10:37 UTC | |
by broquaint (Abbot) on Nov 29, 2002 at 10:42 UTC |