Getopt::EX::RPN - RPN calculation module for Getopt::EX command option
use Getopt::EX::RPN qw(rpn_calc);
Getopt::EX::RPN is a wrapper for Math::RPN package which implement Reverse Polish Notation calculation. rpn_calc function in this package takes additional HEIGHT and WIDTH token which describe terminal height and width.
HEIGHT
WIDTH
rpn_calc recognize following tokens (case-insensitive) and numbers, and ignore anything else. So you can use any other character as a delimiter. Delimiter is not necessary if token boundary is clear.
HEIGHT WIDTH { } +,ADD ++,INCR -,SUB --,DECR *,MUL /,DIV %,MOD POW SQRT SIN COS TAN LOG EXP ABS INT &,AND |,OR !,NOT XOR ~ <,LT <=,LE =,==,EQ >,GT >=,GE !=,NE IF DUP EXCH POP MIN MAX TIME RAND LRAND
Since module Getopt::EX::Func uses comma to separate parameters, you can't use comma as a token separator in RPN expression. This package accept expression like this:
&set(width=WIDTH:2/,height=HEIGHT:DUP:2%-2/)
Kazumasa Utashiro
Copyright Kazumasa Utashiro.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Getopt::EX::RPN, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Getopt::EX::RPN
CPAN shell
perl -MCPAN -e shell install Getopt::EX::RPN
For more information on module installation, please visit the detailed CPAN module installation guide.