Inside this blend file there is a node group called perlinGain which implemented perlin gain using math node. The speed is however a little slow. So I wouldn't say it is ready for production use. I create this mainly for study use.
for more about perlin gain and what it does. You can check these pages:
http://asserttrue.blogspot.tw/2010/01/fast-contrast-adjustment-using-perlins.html
Very nice, well done!