NAME Parse::RPN - Is a minimalist RPN parser/processor (a little like FORTH) SYNOPSIS use Parse::RPN; $result=rpn(string ...); @results=rpn(string ...); string... is a list of RPN operator and value separated by a coma in scalar mode RPN return the result of the calculation (If the stack contain more then one element, you receive a warning and the top value on the stack) in array mode, you receive the content of the stack after evaluation DESCRIPTION RPN receive in entry a scalar of one or more elements coma separated and evaluate as an RPN (Reverse Polish Notation) command. The function split all elements and put in the stack. The operator are case insensitive. The operator are detect as is, if they are alone in the element of the stack. Extra space before or after are allowed (e.g "3,4,ADD" here ADD is an opeartor but it is not the case in "3,4,ADD 1") If element is not part of the predefined operator (dictionary), the element is push as a litteral. If you would like to put a string which is part of the dictionary, put it between quote or double-quote (e.g "3,4,'ADD'" here ADD is a literal and the evaluation reurn ADD and a warning because the stack is not empty) If the string contain a coma, you need also to quote or double-quote the string. (be care to close your quoted or double-quoted string) The evaluation follow the rule of RPN or FORTH or POSTCRIPT or pockect calcutor HP. Look on web for documentation about the use of RPN notation. I use this module in a application where the final user need to create an maintain a configuration file with the possibility to do calculation on variable returned from application. The idea of this module is comming from Math::RPN of Owen DeLong, owen@delong.com that I used for more then a year before some of my customer would like more ... I correct a bug (interversion of > and >=), add the STRING function, pattern search and some STACK functions. AUTHOR Fabrice Dulaunoy INSTALLATION To install this module type the following: perl Makefile.PL make make test make install LICENSE Under the GNU GPL2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Parse::RPN Copyright (C) 2004 DULAUNOY Fabrice Parse::RPN comes with ABSOLUTELY NO WARRANTY; for details See: L This is free software, and you are welcome to redistribute it under certain conditions;