Perl Script for Cygwin

Cut and paste the script exactly as it is so as to avoid comments wrapping round to a line that doesn't begin with a hash # symbol.