added history support of used patterns to the Perl implementation and optimized with perlcritic
small fixes in the Python implementation