Perl scripts used to match a cup pattern on historical stock data