Re: Precedence confusion

2005-01-13 Thread Jan Eden
ill 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: &g

Re: Precedence confusion

2005-01-13 Thread John W. Krahn
| ($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? You can ask perl to do it for you: $ perl -MO=Deparse,-p -e'sub sitemode { my $server = shift || $string =~ /(foo|bar)

Precedence confusion

2005-01-13 Thread Jan Eden
n for it. Could someone shed a light on this precedence confusion? Thanks, 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-m