Affix::Infix2Postfix - Perl extension for converting from infix notation to postfix notation.
use Affix::Infix2Postfix; $inst=Affix::Infix2Postfix->new( 'ops'=>[ {op=>'+'}, {op=>'-'}, {op=>'*'}, {op=>'/'}, {op=>'-',type=>'unary',trans=>'u-'}, {op=>'func',type=>'unary'}, ], 'grouping'=>[qw( \( \) )], 'func'=>[qw( sin cos exp log )], 'vars'=>[qw( x y z)] ); $rc=$inst->translate($str) || die "Error in '$str': ".$inst->{ERRSTR}."\n";
Infix2Postfix as the name suggests converts from infix to postfix notation. The reason why someone would like to do this is that postfix notation is generally much easier to do in computers. For example take an expression like: a+b+c*d. For us humans it's pretty easy to do that calculation. But it's actually much better for computers to get a string of operations such as: a b + c d * +, where the variable names mean put variable on stack.
addi@umich.edu
perl(1).
To install Affix::Infix2Postfix, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Affix::Infix2Postfix
CPAN shell
perl -MCPAN -e shell install Affix::Infix2Postfix
For more information on module installation, please visit the detailed CPAN module installation guide.