Hi John, John W. Krahn wrote on 13.01.2005:
>Jan Eden wrote: >>It also does not show up if I enclose the ternary operator in >>brackets: >> >>my $server = shift || ($string =~ /(foo|bar)/ ? $1 : 'default'); >> >>While this solves my problem, I still do not get the reason for it. >>Could someone shed a light on this precedence confusion? > >If we remove some parentheses: > >my $server = ( shift || ( $string =~ /(foo|bar)/ ) ) ? $1 : >'default'; > Aha! Now I get it. > >Or you could just read perlop: > I did. But I was confused, that's why I posted here. Thanks for clearing things up, Jan -- There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence. - Jeremy S. Anderson -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>