How Perception Affects Behavior