Based mostly on https://nanohub.org/infrastructure/rappture/wiki/DevelopersPerlExtending