The environment affects an organism after, as well as before, it responds to stimuli and the effect to the stimuli becomes consequence. The occasion upon which behavior occurs, the behavior itself, and its consequences are interrelated in the function of reinforcement. For instance, a man sees a beautiful woman, he decides to approach her with conversation. A man sees an unattractive woman, he decides to avoid speaking to her or making eye contact. In this romantic example, the external stimulus causes the man to behave a certain way, which in turn proves the point that through perception of sight, the man will behave a certain way.
Perception then ties into thinking and reasoning.
Thinking involves the cognitive control of stimuli. It turns perception into experience. Behavior is moved into the mind as purpose intention, ideas and acts of will. It is at this stage where learning begins to occur and develop. Then and only then we have learned.