Adds Perl code and fixes whitespace issues

Closes #1