Syntax based folding can be enabled by adding the following lines to the file '~/.vim/syntax/perl.vim': let perl_fold=1 let perl_fold_blocks=1