pglenski has asked for the wisdom of the Perl Monks concerning the following question:
print "Field 1 & 2 Separate or Combined? "; chomp($_=<STDIN>); lc($_); # always sets $OPER to 'c' $_ eq 's' ? $OPER='s' : $OPER='c'; # but this works as expected: $OPER='s' if ($_ eq 's'); $OPER='c' if ($_ eq 'c');
2006-07-18 Retitled by Steve_p, as per Monastery guidelines
Original title: 'trinary operator'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ternary operator
by bobf (Monsignor) on Jul 17, 2006 at 22:26 UTC | |
|
Re: ternary operator
by Hue-Bond (Priest) on Jul 17, 2006 at 22:28 UTC | |
|
Re: ternary operator
by rhesa (Vicar) on Jul 17, 2006 at 22:15 UTC | |
|
Re: ternary operator
by crashtest (Curate) on Jul 17, 2006 at 23:51 UTC | |
|
Re: ternary operator
by johngg (Canon) on Jul 17, 2006 at 22:18 UTC | |
|
Re: ternary operator
by GrandFather (Saint) on Jul 17, 2006 at 22:36 UTC | |
by japhy (Canon) on Jul 17, 2006 at 22:55 UTC | |
by GrandFather (Saint) on Jul 17, 2006 at 23:30 UTC | |
by Sidhekin (Priest) on Jul 17, 2006 at 23:45 UTC | |
|
Re: ternary operator
by Moron (Curate) on Jul 18, 2006 at 09:32 UTC |