The imperfect and the perfect tenses in French are both ways of expressing something which happened in the past. However, you cannot use them interchangeably. The perfect tense, also known as the Passe Compose or the Simple past is used to describe an action that you did once in the past, on one instance. For example, to say 'last weekend I went to the cinema' you would use the perfect tense as you went on one, definite occasion: 'le weekend dernier je suis alle au cinema'. The imperfect tense, however, is used to describe something that you used to do, like a habit or a regular activity, or something that you were doing. To say 'I used to eat lots of chocolate but now I prefer to eat apples' you would use the imperfect tense: 'je mangeais beaucoup de chocolat mais maintenant je prefere manger les pommes.' Similarly, to describe an action that took place over an amount of time, for example 'I was doing my homework while I watched the television' you would use the imperfect tense to conjugate both verbs: 'je faisais mes devoirs pendant que je regardais la tele'. (note: the box I completed this answer in did not allow me to use accents, apologies).