Help for this page
function GetPerlFold() if getline(v:lnum) =~ '^\s*sub\s' ... endfunction setlocal foldexpr=GetPerlFold() setlocal foldmethod=expr