array error/deprecations from perl
Merge pull request #300 from CityDweller/array_errors

array error/deprecations from perl and some formatting changes according to the Perl best practices.