Max Pain / Option Pain command line calculator in Perl