As Perl programmers declare variables in their program, they take some memory. It is up to the programmer to make sure that the program is utilizing memory in the best possible way. Programmers take care of memory leakage for efficient programming. Perl has an excellent garbage collector but with an exception. If a programmer uses global variables at all times, rather than local variables (where the garbage collector takes care of these variables as they go out of scope), they will end up using lots of extra memory space. It is because the garbage collector will not remove the unused storage and hence the memory locations will remain occupied unless the computer restarts.