Security fixes and Style for Perl Scripts