The question is worrying. It implies that you cannot ask the trainer about this, and you should. Maybe you could ask your trainer how Perl manages its heap, and how heap memory is managed by the operating system for reuse.
Does the trainer mean that other comparible languages behave in a differnt way? That is the implication of the question.
Others have answered your question in detail concerning Perl, but be reassured that Perl is no worse in its memory handling than other dynamic languages, and some would argue it is better.