in reply to Re^2: Need help with binding event in Tk
in thread Need help with binding event in Tk
$key eq "year" ? &show($bros->{$data}->[$list]) : $index = 0; while($bros->{$ydx[$list]}->[$index]->{$key} !~ $data/i){ $index++; } $yr = $ydx[$list]; &show($bros->{$ydx[$list]}->[$index]);
the indentation is hiding what's happening. When written:
$key eq "year" ? &show($bros->{$data}->[$list]) : $index = 0; while($bros->{$ydx[$list]}->[$index]->{$key} !~ /$data/i){ $index++; } $yr = $ydx[$list]; &show($bros->{$ydx[$list]}->[$index]);
it is much more obvious that the while loop and two following statements are executed no matter what value $key holds.
|
|---|