I guess you are taking Qatar Airways. I took the same route and you don't have to worry about immigration. At the port of entry, you will just be asked few questions like where are you going and stuffs, will see your passport, study permit and declaration form and will give you back all the docs with just some sort of marking on the declaration form (they won't give you the study permit at that place). Then you will have to proceed to downstairs, collect your baggage, and at the exit point (you will get to know it with ease over there), you will be directed towards another room instead of the lounge where they will take your declaration card at the entrance, ask you to take a seat, after some time call your name, take your passport and within 5 mins you will be holding your passport with your permit stapled to it
and then you will exit to the lounge where you will be giving back your luggage and then go to the designated gate. I kinda forgot about the luggage collection and giving back thingy but you won't have any problem with that (signs are all over the place).
thanks a lot buddy yap qatar air ways same route i havnt taken yet but they told me so i wanted to confirm first ...thanks once again to pmm and rhassan