Fixes #23044. Function to install perl modules.

Fixes http://projects.puppetlabs.com/issues/23044