in reply to Re: Need help with binding event in Tk
in thread Need help with binding event in Tk

Okay that's where I am a bit confused. I thought since I'd defined my conditional, if it was true, then the show sub would execute, and if not, then the other set of code would execute. Since the colon is there, shouldn't that have seperated the two conditions?

There is no emoticon for what I'm feeling now.
  • Comment on Re^2: Need help with binding event in Tk

Replies are listed 'Best First'.
Re^3: Need help with binding event in Tk
by runrig (Abbot) on Jul 25, 2004 at 01:22 UTC
    Check perlop. '?:' has higher precedence than '=', so your code is equivalent to:
    ( ($key eq "year") ? &show($bros->{$data}->[$list]) : $index ) = 0;
    And since you didn't want to return any value (not even an lvalue) from the '?:' operator, you would have been better off using a conventional if (...) {...} else {...} construct. Using '?:' in a void context can be confusing to a maintenance programmer.