petdance/vim-perl — pull request #79 by justone (2012-05-13 06:22:09+00:00)
Title: fold subs passed as last arg to function with '=>'

Some frameworks (e.g. Dancer, Test::More) use a style like this to pass
a code block to a subroutine:

subname 'description' => sub {
# some implementation
};

This change makes it so that the above will fold.

---

All I added was the the possibility of something with a '=>' before the sub keyword `\(\w\+.*=>\s\+\)\?` and conditionally allowing there to be a semicolon at the end of the block `;\?`.