By minimizing, I suppose, you mean the folding code
:help fold
z Ccloses all folds recursively under the cursor, z Ccloses one fold. z oopens the cursor under the button, and z Rrecursively opens all the folds.
see also
:help :foldmethod
For Perl you will need :set foldmethod=syntax.
source
share